home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / System / System-Utilities / Mac-OS X / iCal Birthday Shifter / Source / AppController.m < prev    next >
MacBinary  |  2002-09-25  |  15.0 KB  |  [□□□□/□□□□]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Ultima 6 (music/ultima6) ext Supported
1% dexvert PC-98 Music (music/pc98Music) ext Unsupported
1% dexvert Amiga E Module (other/amigaEModule) ext Unsupported
1% dexvert ECX module (other/ecxModule) ext Unsupported
1% dexvert Maple Common Binary (other/mapleCommonBinary) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Wed Sep 25 09:50:40 2002, modified Wed Sep 25 09:50:40 2002, 14804 bytes "AppController.m" , at 0x3a54 286 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[□□□□]
macFileCreator[□□□□]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 41 70 70 43 6f 6e | 74 72 6f 6c 6c 65 72 2e |..AppCon|troller.|
|00000010| 6d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |m.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 01 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 39 d4 00 | 00 01 1e b9 b7 6f b0 b9 |.....9..|.....o..|
|00000060| b7 6f b0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.o......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fe 14 00 00 |........|........|
|00000080| 23 69 6d 70 6f 72 74 20 | 22 41 70 70 43 6f 6e 74 |#import |"AppCont|
|00000090| 72 6f 6c 6c 65 72 2e 68 | 22 0a 0a 40 69 6d 70 6c |roller.h|"..@impl|
|000000a0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 41 70 70 43 6f |ementati|on AppCo|
|000000b0| 6e 74 72 6f 6c 6c 65 72 | 0a 0a 2d 20 28 69 64 29 |ntroller|..- (id)|
|000000c0| 69 6e 69 74 0a 7b 0a 20 | 20 20 20 4e 53 4d 75 74 |init.{. | NSMut|
|000000d0| 61 62 6c 65 44 69 63 74 | 69 6f 6e 61 72 79 20 2a |ableDict|ionary *|
|000000e0| 64 65 66 61 75 6c 74 56 | 61 6c 75 65 73 20 3d 20 |defaultV|alues = |
|000000f0| 5b 4e 53 4d 75 74 61 62 | 6c 65 44 69 63 74 69 6f |[NSMutab|leDictio|
|00000100| 6e 61 72 79 20 64 69 63 | 74 69 6f 6e 61 72 79 5d |nary dic|tionary]|
|00000110| 3b 0a 20 20 20 20 0a 20 | 20 20 20 69 66 20 28 73 |;. . | if (s|
|00000120| 65 6c 66 20 3d 20 5b 73 | 75 70 65 72 20 69 6e 69 |elf = [s|uper ini|
|00000130| 74 5d 29 20 7b 0a 20 20 | 20 20 20 20 20 20 2f 2f |t]) {. | //|
|00000140| 20 52 65 67 69 73 74 65 | 72 20 64 65 66 61 75 6c | Registe|r defaul|
|00000150| 74 73 0a 20 20 20 20 20 | 20 20 20 5b 64 65 66 61 |ts. | [defa|
|00000160| 75 6c 74 56 61 6c 75 65 | 73 20 73 65 74 4f 62 6a |ultValue|s setObj|
|00000170| 65 63 74 3a 5b 4e 53 4e | 75 6d 62 65 72 20 6e 75 |ect:[NSN|umber nu|
|00000180| 6d 62 65 72 57 69 74 68 | 42 6f 6f 6c 3a 4e 4f 5d |mberWith|Bool:NO]|
|00000190| 20 66 6f 72 4b 65 79 3a | 53 53 5f 49 42 53 5f 43 | forKey:|SS_IBS_C|
|000001a0| 6f 70 79 41 6c 6c 5f 4b | 65 79 5d 3b 0a 20 20 20 |opyAll_K|ey];. |
|000001b0| 20 20 20 20 20 5b 64 65 | 66 61 75 6c 74 56 61 6c | [de|faultVal|
|000001c0| 75 65 73 20 73 65 74 4f | 62 6a 65 63 74 3a 4e 53 |ues setO|bject:NS|
|000001d0| 4c 6f 63 61 6c 69 7a 65 | 64 53 74 72 69 6e 67 28 |Localize|dString(|
|000001e0| 40 22 44 65 66 61 75 6c | 74 45 76 65 6e 74 4e 61 |@"Defaul|tEventNa|
|000001f0| 6d 65 53 74 72 22 2c 20 | 6e 69 6c 29 20 66 6f 72 |meStr", |nil) for|
|00000200| 4b 65 79 3a 53 53 5f 49 | 42 53 5f 45 76 65 6e 74 |Key:SS_I|BS_Event|
|00000210| 54 69 74 6c 65 5f 4b 65 | 79 5d 3b 0a 20 20 20 20 |Title_Ke|y];. |
|00000220| 20 20 20 20 5b 64 65 66 | 61 75 6c 74 56 61 6c 75 | [def|aultValu|
|00000230| 65 73 20 73 65 74 4f 62 | 6a 65 63 74 3a 4e 53 4c |es setOb|ject:NSL|
|00000240| 6f 63 61 6c 69 7a 65 64 | 53 74 72 69 6e 67 28 40 |ocalized|String(@|
|00000250| 22 42 69 72 74 68 64 61 | 79 73 22 2c 20 6e 69 6c |"Birthda|ys", nil|
|00000260| 29 20 66 6f 72 4b 65 79 | 3a 53 53 5f 49 42 53 5f |) forKey|:SS_IBS_|
|00000270| 43 61 6c 65 6e 64 61 72 | 4e 61 6d 65 5f 4b 65 79 |Calendar|Name_Key|
|00000280| 5d 3b 0a 20 20 20 20 20 | 20 20 20 5b 5b 4e 53 55 |];. | [[NSU|
|00000290| 73 65 72 44 65 66 61 75 | 6c 74 73 20 73 74 61 6e |serDefau|lts stan|
|000002a0| 64 61 72 64 55 73 65 72 | 44 65 66 61 75 6c 74 73 |dardUser|Defaults|
|000002b0| 5d 20 72 65 67 69 73 74 | 65 72 44 65 66 61 75 6c |] regist|erDefaul|
|000002c0| 74 73 3a 64 65 66 61 75 | 6c 74 56 61 6c 75 65 73 |ts:defau|ltValues|
|000002d0| 5d 3b 0a 20 20 20 20 20 | 20 20 20 0a 20 20 20 20 |];. | . |
|000002e0| 20 20 20 20 63 61 6c 65 | 6e 64 61 72 73 20 3d 20 | cale|ndars = |
|000002f0| 5b 5b 73 65 6c 66 20 67 | 65 74 43 61 6c 65 6e 64 |[[self g|etCalend|
|00000300| 61 72 73 5d 20 72 65 74 | 61 69 6e 5d 3b 0a 20 20 |ars] ret|ain];. |
|00000310| 20 20 20 20 20 20 63 61 | 6c 4e 61 6d 65 73 20 3d | ca|lNames =|
|00000320| 20 5b 5b 5b 63 61 6c 65 | 6e 64 61 72 73 20 61 6c | [[[cale|ndars al|
|00000330| 6c 4b 65 79 73 5d 20 73 | 6f 72 74 65 64 41 72 72 |lKeys] s|ortedArr|
|00000340| 61 79 55 73 69 6e 67 53 | 65 6c 65 63 74 6f 72 3a |ayUsingS|elector:|
|00000350| 40 73 65 6c 65 63 74 6f | 72 28 63 61 73 65 49 6e |@selecto|r(caseIn|
|00000360| 73 65 6e 73 69 74 69 76 | 65 43 6f 6d 70 61 72 65 |sensitiv|eCompare|
|00000370| 3a 29 5d 20 72 65 74 61 | 69 6e 5d 3b 0a 20 20 20 |:)] reta|in];. |
|00000380| 20 20 20 20 20 62 69 72 | 74 68 64 61 79 50 65 6f | bir|thdayPeo|
|00000390| 70 6c 65 20 3d 20 5b 5b | 73 65 6c 66 20 67 65 74 |ple = [[|self get|
|000003a0| 42 69 72 74 68 64 61 79 | 50 65 6f 70 6c 65 5d 20 |Birthday|People] |
|000003b0| 72 65 74 61 69 6e 5d 3b | 0a 20 20 20 20 20 20 20 |retain];|. |
|000003c0| 20 63 6f 70 79 69 6e 67 | 20 3d 20 4e 4f 3b 0a 20 | copying| = NO;. |
|000003d0| 20 20 20 20 20 20 20 0a | 20 20 20 20 20 20 20 20 | .| |
|000003e0| 2f 2f 20 52 65 61 64 20 | 64 65 66 61 75 6c 74 73 |// Read |defaults|
|000003f0| 0a 20 20 20 20 20 20 20 | 20 63 6f 70 79 41 6c 6c |. | copyAll|
|00000400| 20 3d 20 5b 5b 5b 4e 53 | 55 73 65 72 44 65 66 61 | = [[[NS|UserDefa|
|00000410| 75 6c 74 73 20 73 74 61 | 6e 64 61 72 64 55 73 65 |ults sta|ndardUse|
|00000420| 72 44 65 66 61 75 6c 74 | 73 5d 20 6f 62 6a 65 63 |rDefault|s] objec|
|00000430| 74 46 6f 72 4b 65 79 3a | 53 53 5f 49 42 53 5f 43 |tForKey:|SS_IBS_C|
|00000440| 6f 70 79 41 6c 6c 5f 4b | 65 79 5d 20 62 6f 6f 6c |opyAll_K|ey] bool|
|00000450| 56 61 6c 75 65 5d 3b 0a | 20 20 20 20 20 20 20 20 |Value];.| |
|00000460| 5b 73 65 6c 66 20 73 65 | 74 45 76 65 6e 74 54 69 |[self se|tEventTi|
|00000470| 74 6c 65 3a 5b 5b 4e 53 | 55 73 65 72 44 65 66 61 |tle:[[NS|UserDefa|
|00000480| 75 6c 74 73 20 73 74 61 | 6e 64 61 72 64 55 73 65 |ults sta|ndardUse|
|00000490| 72 44 65 66 61 75 6c 74 | 73 5d 20 73 74 72 69 6e |rDefault|s] strin|
|000004a0| 67 46 6f 72 4b 65 79 3a | 53 53 5f 49 42 53 5f 45 |gForKey:|SS_IBS_E|
|000004b0| 76 65 6e 74 54 69 74 6c | 65 5f 4b 65 79 5d 5d 3b |ventTitl|e_Key]];|
|000004c0| 0a 0a 20 20 20 20 20 20 | 20 20 2f 2f 20 50 72 65 |.. | // Pre|
|000004d0| 70 61 72 65 20 41 64 64 | 72 65 73 73 20 42 6f 6f |pare Add|ress Boo|
|000004e0| 6b 20 64 61 74 61 62 61 | 73 65 0a 20 20 20 20 20 |k databa|se. |
|000004f0| 20 20 20 4e 53 44 69 63 | 74 69 6f 6e 61 72 79 20 | NSDic|tionary |
|00000500| 2a 62 64 61 79 41 64 64 | 65 64 44 61 74 65 50 72 |*bdayAdd|edDatePr|
|00000510| 6f 70 65 72 74 79 20 3d | 0a 20 20 20 20 20 20 20 |operty =|. |
|00000520| 20 20 20 20 20 5b 4e 53 | 44 69 63 74 69 6f 6e 61 | [NS|Dictiona|
|00000530| 72 79 20 64 69 63 74 69 | 6f 6e 61 72 79 57 69 74 |ry dicti|onaryWit|
|00000540| 68 4f 62 6a 65 63 74 73 | 41 6e 64 4b 65 79 73 3a |hObjects|AndKeys:|
|00000550| 5b 4e 53 4e 75 6d 62 65 | 72 20 6e 75 6d 62 65 72 |[NSNumbe|r number|
|00000560| 57 69 74 68 49 6e 74 3a | 6b 41 42 44 61 74 65 50 |WithInt:|kABDateP|
|00000570| 72 6f 70 65 72 74 79 5d | 2c 20 53 53 5f 49 42 53 |roperty]|, SS_IBS|
|00000580| 5f 42 64 61 79 41 64 64 | 65 64 44 61 74 65 5f 50 |_BdayAdd|edDate_P|
|00000590| 72 6f 70 2c 20 6e 69 6c | 5d 3b 0a 20 20 20 20 20 |rop, nil|];. |
|000005a0| 20 20 20 0a 20 20 20 20 | 20 20 20 20 69 6e 74 20 | . | int |
|000005b0| 6e 75 6d 62 65 72 4f 66 | 50 72 6f 70 65 72 74 69 |numberOf|Properti|
|000005c0| 65 73 41 64 64 65 64 3b | 0a 20 20 20 20 20 20 20 |esAdded;|. |
|000005d0| 20 6e 75 6d 62 65 72 4f | 66 50 72 6f 70 65 72 74 | numberO|fPropert|
|000005e0| 69 65 73 41 64 64 65 64 | 20 3d 20 5b 41 42 50 65 |iesAdded| = [ABPe|
|000005f0| 72 73 6f 6e 20 61 64 64 | 50 72 6f 70 65 72 74 69 |rson add|Properti|
|00000600| 65 73 41 6e 64 54 79 70 | 65 73 3a 62 64 61 79 41 |esAndTyp|es:bdayA|
|00000610| 64 64 65 64 44 61 74 65 | 50 72 6f 70 65 72 74 79 |ddedDate|Property|
|00000620| 5d 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 72 65 74 |];. }|. ret|
|00000630| 75 72 6e 20 73 65 6c 66 | 3b 0a 7d 0a 0a 2d 20 28 |urn self|;.}..- (|
|00000640| 76 6f 69 64 29 64 65 61 | 6c 6c 6f 63 0a 7b 0a 20 |void)dea|lloc.{. |
|00000650| 20 20 20 5b 63 61 6c 4e | 61 6d 65 73 20 72 65 6c | [calN|ames rel|
|00000660| 65 61 73 65 5d 3b 0a 20 | 20 20 20 5b 63 61 6c 65 |ease];. | [cale|
|00000670| 6e 64 61 72 73 20 72 65 | 6c 65 61 73 65 5d 3b 0a |ndars re|lease];.|
|00000680| 20 20 20 20 5b 73 75 70 | 65 72 20 64 65 61 6c 6c | [sup|er deall|
|00000690| 6f 63 5d 3b 0a 7d 0a 0a | 2d 20 28 76 6f 69 64 29 |oc];.}..|- (void)|
|000006a0| 61 77 61 6b 65 46 72 6f | 6d 4e 69 62 0a 7b 0a 20 |awakeFro|mNib.{. |
|000006b0| 20 20 20 69 66 20 28 62 | 69 72 74 68 64 61 79 50 | if (b|irthdayP|
|000006c0| 65 6f 70 6c 65 20 21 3d | 20 6e 69 6c 20 26 26 20 |eople !=| nil && |
|000006d0| 5b 62 69 72 74 68 64 61 | 79 50 65 6f 70 6c 65 20 |[birthda|yPeople |
|000006e0| 63 6f 75 6e 74 5d 20 3e | 20 30 29 20 7b 0a 20 20 |count] >| 0) {. |
|000006f0| 20 20 20 20 20 20 6e 75 | 6d 55 6e 63 6f 70 69 65 | nu|mUncopie|
|00000700| 64 42 64 61 79 73 20 3d | 20 30 3b 0a 0a 20 20 20 |dBdays =| 0;.. |
|00000710| 20 20 20 20 20 4e 53 45 | 6e 75 6d 65 72 61 74 6f | NSE|numerato|
|00000720| 72 20 2a 65 6e 75 6d 65 | 72 61 74 6f 72 20 3d 20 |r *enume|rator = |
|00000730| 5b 62 69 72 74 68 64 61 | 79 50 65 6f 70 6c 65 20 |[birthda|yPeople |
|00000740| 6f 62 6a 65 63 74 45 6e | 75 6d 65 72 61 74 6f 72 |objectEn|umerator|
|00000750| 5d 3b 0a 20 20 20 20 20 | 20 20 20 41 42 50 65 72 |];. | ABPer|
|00000760| 73 6f 6e 20 2a 70 65 72 | 73 6f 6e 3b 0a 0a 20 20 |son *per|son;.. |
|00000770| 20 20 20 20 20 20 77 68 | 69 6c 65 20 28 70 65 72 | wh|ile (per|
|00000780| 73 6f 6e 20 3d 20 5b 65 | 6e 75 6d 65 72 61 74 6f |son = [e|numerato|
|00000790| 72 20 6e 65 78 74 4f 62 | 6a 65 63 74 5d 29 20 7b |r nextOb|ject]) {|
|000007a0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|000007b0| 28 5b 70 65 72 73 6f 6e | 20 76 61 6c 75 65 46 6f |([person| valueFo|
|000007c0| 72 50 72 6f 70 65 72 74 | 79 3a 53 53 5f 49 42 53 |rPropert|y:SS_IBS|
|000007d0| 5f 42 64 61 79 41 64 64 | 65 64 44 61 74 65 5f 50 |_BdayAdd|edDate_P|
|000007e0| 72 6f 70 5d 20 3d 3d 20 | 6e 69 6c 29 20 7b 0a 20 |rop] == |nil) {. |
|000007f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6e | | n|
|00000800| 75 6d 55 6e 63 6f 70 69 | 65 64 42 64 61 79 73 2b |umUncopi|edBdays+|
|00000810| 2b 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |+;. | }|
|00000820| 0a 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 |. | }. |
|00000830| 20 20 20 0a 20 20 20 20 | 20 20 20 20 5b 62 69 72 | . | [bir|
|00000840| 74 68 64 61 79 73 43 6f | 75 6e 74 46 69 65 6c 64 |thdaysCo|untField|
|00000850| 20 73 65 74 53 74 72 69 | 6e 67 56 61 6c 75 65 3a | setStri|ngValue:|
|00000860| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 5b 4e 53 |. | [NS|
|00000870| 53 74 72 69 6e 67 20 73 | 74 72 69 6e 67 57 69 74 |String s|tringWit|
|00000880| 68 46 6f 72 6d 61 74 3a | 4e 53 4c 6f 63 61 6c 69 |hFormat:|NSLocali|
|00000890| 7a 65 64 53 74 72 69 6e | 67 28 40 22 43 6f 6e 74 |zedStrin|g(@"Cont|
|000008a0| 61 63 74 73 42 69 72 74 | 68 64 61 79 73 53 74 72 |actsBirt|hdaysStr|
|000008b0| 22 2c 20 6e 69 6c 29 2c | 0a 20 20 20 20 20 20 20 |", nil),|. |
|000008c0| 20 20 20 20 20 20 20 20 | 20 5b 5b 5b 41 42 41 64 | | [[[ABAd|
|000008d0| 64 72 65 73 73 42 6f 6f | 6b 20 73 68 61 72 65 64 |dressBoo|k shared|
|000008e0| 41 64 64 72 65 73 73 42 | 6f 6f 6b 5d 20 70 65 6f |AddressB|ook] peo|
|000008f0| 70 6c 65 5d 20 63 6f 75 | 6e 74 5d 2c 20 5b 62 69 |ple] cou|nt], [bi|
|00000900| 72 74 68 64 61 79 50 65 | 6f 70 6c 65 20 63 6f 75 |rthdayPe|ople cou|
|00000910| 6e 74 5d 2c 20 6e 75 6d | 55 6e 63 6f 70 69 65 64 |nt], num|Uncopied|
|00000920| 42 64 61 79 73 5d 5d 3b | 0a 20 20 20 20 7d 0a 20 |Bdays]];|. }. |
|00000930| 20 20 20 4e 53 49 6d 61 | 67 65 43 65 6c 6c 20 2a | NSIma|geCell *|
|00000940| 63 65 6c 6c 3b 0a 20 20 | 20 20 4e 53 54 61 62 6c |cell;. | NSTabl|
|00000950| 65 43 6f 6c 75 6d 6e 20 | 2a 74 68 65 43 6f 6c 75 |eColumn |*theColu|
|00000960| 6d 6e 3b 0a 20 20 20 20 | 0a 20 20 20 20 74 68 65 |mn;. |. the|
|00000970| 43 6f 6c 75 6d 6e 20 3d | 20 5b 63 61 6c 54 61 62 |Column =| [calTab|
|00000980| 6c 65 20 74 61 62 6c 65 | 43 6f 6c 75 6d 6e 57 69 |le table|ColumnWi|
|00000990| 74 68 49 64 65 6e 74 69 | 66 69 65 72 3a 40 22 69 |thIdenti|fier:@"i|
|000009a0| 63 6f 6e 22 5d 3b 0a 20 | 20 20 20 5b 63 61 6c 54 |con"];. | [calT|
|000009b0| 61 62 6c 65 20 73 65 74 | 52 6f 77 48 65 69 67 68 |able set|RowHeigh|
|000009c0| 74 3a 31 36 5d 3b 0a 20 | 20 20 20 5b 74 68 65 43 |t:16];. | [theC|
|000009d0| 6f 6c 75 6d 6e 20 73 65 | 74 57 69 64 74 68 3a 5b |olumn se|tWidth:[|
|000009e0| 63 61 6c 54 61 62 6c 65 | 20 72 6f 77 48 65 69 67 |calTable| rowHeig|
|000009f0| 68 74 5d 5d 3b 0a 0a 20 | 20 20 20 63 65 6c 6c 20 |ht]];.. | cell |
|00000a00| 3d 20 5b 4e 53 49 6d 61 | 67 65 43 65 6c 6c 20 6e |= [NSIma|geCell n|
|00000a10| 65 77 5d 3b 0a 20 20 20 | 20 5b 74 68 65 43 6f 6c |ew];. | [theCol|
|00000a20| 75 6d 6e 20 73 65 74 44 | 61 74 61 43 65 6c 6c 3a |umn setD|ataCell:|
|00000a30| 63 65 6c 6c 5d 3b 0a 0a | 20 20 20 20 5b 73 65 6c |cell];..| [sel|
|00000a40| 66 20 74 61 62 6c 65 56 | 69 65 77 53 65 6c 65 63 |f tableV|iewSelec|
|00000a50| 74 69 6f 6e 44 69 64 43 | 68 61 6e 67 65 3a 6e 69 |tionDidC|hange:ni|
|00000a60| 6c 5d 3b 20 2f 2f 20 65 | 6e 61 62 6c 65 2f 64 69 |l]; // e|nable/di|
|00000a70| 73 61 62 6c 65 20 63 6f | 70 79 42 75 74 74 6f 6e |sable co|pyButton|
|00000a80| 20 61 73 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 | as appr|opriate |
|00000a90| 66 6f 72 20 69 6e 69 74 | 69 61 6c 20 73 65 6c 65 |for init|ial sele|
|00000aa0| 63 74 69 6f 6e 0a 0a 20 | 20 20 20 2f 2f 20 53 65 |ction.. | // Se|
|00000ab0| 6c 65 63 74 20 6c 61 73 | 74 20 75 73 65 64 20 63 |lect las|t used c|
|00000ac0| 61 6c 65 6e 64 61 72 0a | 20 20 20 20 69 6e 74 20 |alendar.| int |
|00000ad0| 62 64 61 79 52 6f 77 20 | 3d 20 5b 63 61 6c 4e 61 |bdayRow |= [calNa|
|00000ae0| 6d 65 73 20 69 6e 64 65 | 78 4f 66 4f 62 6a 65 63 |mes inde|xOfObjec|
|00000af0| 74 3a 5b 5b 4e 53 55 73 | 65 72 44 65 66 61 75 6c |t:[[NSUs|erDefaul|
|00000b00| 74 73 20 73 74 61 6e 64 | 61 72 64 55 73 65 72 44 |ts stand|ardUserD|
|00000b10| 65 66 61 75 6c 74 73 5d | 20 73 74 72 69 6e 67 46 |efaults]| stringF|
|00000b20| 6f 72 4b 65 79 3a 53 53 | 5f 49 42 53 5f 43 61 6c |orKey:SS|_IBS_Cal|
|00000b30| 65 6e 64 61 72 4e 61 6d | 65 5f 4b 65 79 5d 5d 3b |endarNam|e_Key]];|
|00000b40| 0a 20 20 20 20 69 66 20 | 28 62 64 61 79 52 6f 77 |. if |(bdayRow|
|00000b50| 20 21 3d 20 4e 53 4e 6f | 74 46 6f 75 6e 64 29 20 | != NSNo|tFound) |
|00000b60| 7b 0a 20 20 20 20 20 20 | 20 20 5b 63 61 6c 54 61 |{. | [calTa|
|00000b70| 62 6c 65 20 73 65 6c 65 | 63 74 52 6f 77 3a 62 64 |ble sele|ctRow:bd|
|00000b80| 61 79 52 6f 77 20 62 79 | 45 78 74 65 6e 64 69 6e |ayRow by|Extendin|
|00000b90| 67 53 65 6c 65 63 74 69 | 6f 6e 3a 4e 4f 5d 3b 0a |gSelecti|on:NO];.|
|00000ba0| 20 20 20 20 7d 0a 7d 0a | 0a 2f 2f 20 71 75 69 74 | }.}.|.// quit|
|00000bb0| 20 69 66 20 77 69 6e 64 | 6f 77 20 69 73 20 63 6c | if wind|ow is cl|
|00000bc0| 6f 73 65 64 0a 2d 20 28 | 42 4f 4f 4c 29 61 70 70 |osed.- (|BOOL)app|
|00000bd0| 6c 69 63 61 74 69 6f 6e | 53 68 6f 75 6c 64 54 65 |lication|ShouldTe|
|00000be0| 72 6d 69 6e 61 74 65 41 | 66 74 65 72 4c 61 73 74 |rminateA|fterLast|
|00000bf0| 57 69 6e 64 6f 77 43 6c | 6f 73 65 64 3a 28 4e 53 |WindowCl|osed:(NS|
|00000c00| 41 70 70 6c 69 63 61 74 | 69 6f 6e 20 2a 29 73 65 |Applicat|ion *)se|
|00000c10| 6e 64 65 72 0a 7b 0a 20 | 20 20 20 72 65 74 75 72 |nder.{. | retur|
|00000c20| 6e 20 59 45 53 3b 0a 7d | 0a 0a 2d 20 28 76 6f 69 |n YES;.}|..- (voi|
|00000c30| 64 29 61 70 70 6c 69 63 | 61 74 69 6f 6e 57 69 6c |d)applic|ationWil|
|00000c40| 6c 54 65 72 6d 69 6e 61 | 74 65 3a 28 4e 53 4e 6f |lTermina|te:(NSNo|
|00000c50| 74 69 66 69 63 61 74 69 | 6f 6e 20 2a 29 6e 6f 74 |tificati|on *)not|
|00000c60| 69 66 69 63 61 74 69 6f | 6e 0a 7b 0a 20 20 20 20 |ificatio|n.{. |
|00000c70| 5b 5b 4e 53 55 73 65 72 | 44 65 66 61 75 6c 74 73 |[[NSUser|Defaults|
|00000c80| 20 73 74 61 6e 64 61 72 | 64 55 73 65 72 44 65 66 | standar|dUserDef|
|00000c90| 61 75 6c 74 73 5d 20 73 | 65 74 4f 62 6a 65 63 74 |aults] s|etObject|
|00000ca0| 3a 5b 63 61 6c 4e 61 6d | 65 73 20 6f 62 6a 65 63 |:[calNam|es objec|
|00000cb0| 74 41 74 49 6e 64 65 78 | 3a 5b 63 61 6c 54 61 62 |tAtIndex|:[calTab|
|00000cc0| 6c 65 20 73 65 6c 65 63 | 74 65 64 52 6f 77 5d 5d |le selec|tedRow]]|
|00000cd0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000ce0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 66 | | f|
|00000d00| 6f 72 4b 65 79 3a 53 53 | 5f 49 42 53 5f 43 61 6c |orKey:SS|_IBS_Cal|
|00000d10| 65 6e 64 61 72 4e 61 6d | 65 5f 4b 65 79 5d 3b 20 |endarNam|e_Key]; |
|00000d20| 2f 2f 20 73 61 76 65 20 | 6e 61 6d 65 20 6f 66 20 |// save |name of |
|00000d30| 6c 61 73 74 20 73 65 6c | 65 63 74 65 64 20 63 61 |last sel|ected ca|
|00000d40| 6c 65 6e 64 61 72 0a 7d | 0a 0a 2d 20 28 49 42 41 |lendar.}|..- (IBA|
|00000d50| 63 74 69 6f 6e 29 73 68 | 6f 77 50 72 65 66 73 3a |ction)sh|owPrefs:|
|00000d60| 28 69 64 29 73 65 6e 64 | 65 72 0a 7b 0a 20 20 20 |(id)send|er.{. |
|00000d70| 20 42 4f 4f 4c 20 73 75 | 63 63 65 73 73 66 75 6c | BOOL su|ccessful|
|00000d80| 20 3d 20 59 45 53 3b 0a | 0a 20 20 20 20 2f 2f 20 | = YES;.|. // |
|00000d90| 53 61 76 65 20 73 65 6c | 65 63 74 65 64 20 63 61 |Save sel|ected ca|
|00000da0| 6c 65 6e 64 61 72 20 68 | 65 72 65 20 74 6f 20 61 |lendar h|ere to a|
|00000db0| 76 6f 69 64 20 4e 53 54 | 61 62 6c 65 56 69 65 77 |void NST|ableView|
|00000dc0| 20 72 65 2d 73 65 6c 65 | 63 74 69 6f 6e 20 73 74 | re-sele|ction st|
|00000dd0| 72 61 6e 67 65 6e 65 73 | 73 20 77 68 65 6e 20 73 |rangenes|s when s|
|00000de0| 68 6f 77 69 6e 67 20 70 | 72 65 66 73 20 73 68 65 |howing p|refs she|
|00000df0| 65 74 20 66 69 72 73 74 | 20 74 69 6d 65 0a 20 20 |et first| time. |
|00000e00| 20 20 5b 5b 4e 53 55 73 | 65 72 44 65 66 61 75 6c | [[NSUs|erDefaul|
|00000e10| 74 73 20 73 74 61 6e 64 | 61 72 64 55 73 65 72 44 |ts stand|ardUserD|
|00000e20| 65 66 61 75 6c 74 73 5d | 20 73 65 74 4f 62 6a 65 |efaults]| setObje|
|00000e30| 63 74 3a 5b 63 61 6c 4e | 61 6d 65 73 20 6f 62 6a |ct:[calN|ames obj|
|00000e40| 65 63 74 41 74 49 6e 64 | 65 78 3a 5b 63 61 6c 54 |ectAtInd|ex:[calT|
|00000e50| 61 62 6c 65 20 73 65 6c | 65 63 74 65 64 52 6f 77 |able sel|ectedRow|
|00000e60| 5d 5d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |]]. | |
|00000e70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e90| 20 66 6f 72 4b 65 79 3a | 53 53 5f 49 42 53 5f 43 | forKey:|SS_IBS_C|
|00000ea0| 61 6c 65 6e 64 61 72 4e | 61 6d 65 5f 4b 65 79 5d |alendarN|ame_Key]|
|00000eb0| 3b 20 2f 2f 20 73 61 76 | 65 20 6e 61 6d 65 20 6f |; // sav|e name o|
|00000ec0| 66 20 6c 61 73 74 20 73 | 65 6c 65 63 74 65 64 20 |f last s|elected |
|00000ed0| 63 61 6c 65 6e 64 61 72 | 0a 20 20 20 20 0a 20 20 |calendar|. . |
|00000ee0| 20 20 69 66 20 28 21 70 | 72 65 66 73 53 68 65 65 | if (!p|refsShee|
|00000ef0| 74 29 20 7b 0a 20 20 20 | 20 20 20 20 20 73 75 63 |t) {. | suc|
|00000f00| 63 65 73 73 66 75 6c 20 | 3d 20 5b 4e 53 42 75 6e |cessful |= [NSBun|
|00000f10| 64 6c 65 20 6c 6f 61 64 | 4e 69 62 4e 61 6d 65 64 |dle load|NibNamed|
|00000f20| 3a 40 22 50 72 65 66 65 | 72 65 6e 63 65 73 22 20 |:@"Prefe|rences" |
|00000f30| 6f 77 6e 65 72 3a 73 65 | 6c 66 5d 3b 0a 20 20 20 |owner:se|lf];. |
|00000f40| 20 7d 0a 20 20 20 20 0a | 20 20 20 20 69 66 20 28 | }. .| if (|
|00000f50| 73 75 63 63 65 73 73 66 | 75 6c 29 20 7b 0a 20 20 |successf|ul) {. |
|00000f60| 20 20 20 20 20 20 5b 63 | 6f 70 79 41 6c 6c 43 68 | [c|opyAllCh|
|00000f70| 65 63 6b 20 73 65 74 53 | 74 61 74 65 3a 63 6f 70 |eck setS|tate:cop|
|00000f80| 79 41 6c 6c 5d 3b 0a 20 | 20 20 20 20 20 20 20 5b |yAll];. | [|
|00000f90| 65 76 65 6e 74 54 69 74 | 6c 65 46 69 65 6c 64 20 |eventTit|leField |
|00000fa0| 73 65 74 53 74 72 69 6e | 67 56 61 6c 75 65 3a 65 |setStrin|gValue:e|
|00000fb0| 76 65 6e 74 54 69 74 6c | 65 5d 3b 0a 20 20 20 20 |ventTitl|e];. |
|00000fc0| 20 20 20 20 5b 73 65 6c | 66 20 63 6f 6e 74 72 6f | [sel|f contro|
|00000fd0| 6c 54 65 78 74 44 69 64 | 43 68 61 6e 67 65 3a 6e |lTextDid|Change:n|
|00000fe0| 69 6c 5d 3b 20 2f 2f 20 | 73 65 74 20 65 6e 61 62 |il]; // |set enab|
|00000ff0| 6c 65 64 20 73 74 61 74 | 75 73 20 6f 66 20 70 72 |led stat|us of pr|
|00001000| 65 66 73 20 62 75 74 74 | 6f 6e 73 0a 20 20 20 20 |efs butt|ons. |
|00001010| 20 20 20 20 0a 20 20 20 | 20 20 20 20 20 5b 4e 53 | . | [NS|
|00001020| 41 70 70 20 62 65 67 69 | 6e 53 68 65 65 74 3a 70 |App begi|nSheet:p|
|00001030| 72 65 66 73 53 68 65 65 | 74 0a 20 20 20 20 20 20 |refsShee|t. |
|00001040| 20 20 20 20 20 6d 6f 64 | 61 6c 46 6f 72 57 69 6e | mod|alForWin|
|00001050| 64 6f 77 3a 5b 63 6f 70 | 79 42 75 74 74 6f 6e 20 |dow:[cop|yButton |
|00001060| 77 69 6e 64 6f 77 5d 0a | 20 20 20 20 20 20 20 20 |window].| |
|00001070| 20 20 20 20 6d 6f 64 61 | 6c 44 65 6c 65 67 61 74 | moda|lDelegat|
|00001080| 65 3a 73 65 6c 66 0a 20 | 20 20 20 20 20 20 20 20 |e:self. | |
|00001090| 20 20 64 69 64 45 6e 64 | 53 65 6c 65 63 74 6f 72 | didEnd|Selector|
|000010a0| 3a 40 73 65 6c 65 63 74 | 6f 72 28 73 68 65 65 74 |:@select|or(sheet|
|000010b0| 44 69 64 45 6e 64 3a 72 | 65 74 75 72 6e 43 6f 64 |DidEnd:r|eturnCod|
|000010c0| 65 3a 63 6f 6e 74 65 78 | 74 49 6e 66 6f 3a 29 0a |e:contex|tInfo:).|
|000010d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 63 6f | | co|
|000010e0| 6e 74 65 78 74 49 6e 66 | 6f 3a 6e 69 6c 5d 3b 0a |ntextInf|o:nil];.|
|000010f0| 20 20 20 20 7d 0a 7d 0a | 0a 2d 20 28 49 42 41 63 | }.}.|.- (IBAc|
|00001100| 74 69 6f 6e 29 6f 6b 53 | 68 65 65 74 3a 28 69 64 |tion)okS|heet:(id|
|00001110| 29 73 65 6e 64 65 72 0a | 7b 0a 20 20 20 20 2f 2f |)sender.|{. //|
|00001120| 20 48 69 64 65 20 74 68 | 65 20 73 68 65 65 74 0a | Hide th|e sheet.|
|00001130| 20 20 20 20 5b 70 72 65 | 66 73 53 68 65 65 74 20 | [pre|fsSheet |
|00001140| 6f 72 64 65 72 4f 75 74 | 3a 73 65 6e 64 65 72 5d |orderOut|:sender]|
|00001150| 3b 0a 20 20 20 20 2f 2f | 20 52 65 74 75 72 6e 20 |;. //| Return |
|00001160| 74 6f 20 6e 6f 72 6d 61 | 6c 20 65 76 65 6e 74 20 |to norma|l event |
|00001170| 68 61 6e 64 6c 69 6e 67 | 0a 20 20 20 20 5b 4e 53 |handling|. [NS|
|00001180| 41 70 70 20 65 6e 64 53 | 68 65 65 74 3a 70 72 65 |App endS|heet:pre|
|00001190| 66 73 53 68 65 65 74 20 | 72 65 74 75 72 6e 43 6f |fsSheet |returnCo|
|000011a0| 64 65 3a 4e 53 4f 4b 42 | 75 74 74 6f 6e 5d 3b 0a |de:NSOKB|utton];.|
|000011b0| 7d 0a 0a 2d 20 28 49 42 | 41 63 74 69 6f 6e 29 63 |}..- (IB|Action)c|
|000011c0| 61 6e 63 65 6c 53 68 65 | 65 74 3a 28 69 64 29 73 |ancelShe|et:(id)s|
|000011d0| 65 6e 64 65 72 0a 7b 0a | 20 20 20 20 2f 2f 20 48 |ender.{.| // H|
|000011e0| 69 64 65 20 74 68 65 20 | 73 68 65 65 74 0a 20 20 |ide the |sheet. |
|000011f0| 20 20 5b 70 72 65 66 73 | 53 68 65 65 74 20 6f 72 | [prefs|Sheet or|
|00001200| 64 65 72 4f 75 74 3a 73 | 65 6e 64 65 72 5d 3b 0a |derOut:s|ender];.|
|00001210| 20 20 20 20 2f 2f 20 52 | 65 74 75 72 6e 20 74 6f | // R|eturn to|
|00001220| 20 6e 6f 72 6d 61 6c 20 | 65 76 65 6e 74 20 68 61 | normal |event ha|
|00001230| 6e 64 6c 69 6e 67 0a 20 | 20 20 20 5b 4e 53 41 70 |ndling. | [NSAp|
|00001240| 70 20 65 6e 64 53 68 65 | 65 74 3a 70 72 65 66 73 |p endShe|et:prefs|
|00001250| 53 68 65 65 74 20 72 65 | 74 75 72 6e 43 6f 64 65 |Sheet re|turnCode|
|00001260| 3a 4e 53 43 61 6e 63 65 | 6c 42 75 74 74 6f 6e 5d |:NSCance|lButton]|
|00001270| 3b 0a 7d 0a 0a 2d 20 28 | 49 42 41 63 74 69 6f 6e |;.}..- (|IBAction|
|00001280| 29 64 65 66 61 75 6c 74 | 45 76 65 6e 74 54 69 74 |)default|EventTit|
|00001290| 6c 65 3a 28 69 64 29 73 | 65 6e 64 65 72 0a 7b 0a |le:(id)s|ender.{.|
|000012a0| 20 20 20 20 5b 65 76 65 | 6e 74 54 69 74 6c 65 46 | [eve|ntTitleF|
|000012b0| 69 65 6c 64 20 73 65 74 | 53 74 72 69 6e 67 56 61 |ield set|StringVa|
|000012c0| 6c 75 65 3a 4e 53 4c 6f | 63 61 6c 69 7a 65 64 53 |lue:NSLo|calizedS|
|000012d0| 74 72 69 6e 67 28 40 22 | 44 65 66 61 75 6c 74 45 |tring(@"|DefaultE|
|000012e0| 76 65 6e 74 4e 61 6d 65 | 53 74 72 22 2c 20 6e 69 |ventName|Str", ni|
|000012f0| 6c 29 5d 3b 0a 20 20 20 | 20 5b 73 65 6c 66 20 63 |l)];. | [self c|
|00001300| 6f 6e 74 72 6f 6c 54 65 | 78 74 44 69 64 43 68 61 |ontrolTe|xtDidCha|
|00001310| 6e 67 65 3a 6e 69 6c 5d | 3b 20 2f 2f 20 73 65 74 |nge:nil]|; // set|
|00001320| 20 65 6e 61 62 6c 65 64 | 20 73 74 61 74 75 73 20 | enabled| status |
|00001330| 6f 66 20 70 72 65 66 73 | 20 62 75 74 74 6f 6e 73 |of prefs| buttons|
|00001340| 0a 7d 0a 0a 2d 20 28 76 | 6f 69 64 29 73 68 65 65 |.}..- (v|oid)shee|
|00001350| 74 44 69 64 45 6e 64 3a | 28 4e 53 57 69 6e 64 6f |tDidEnd:|(NSWindo|
|00001360| 77 20 2a 29 73 68 65 65 | 74 20 72 65 74 75 72 6e |w *)shee|t return|
|00001370| 43 6f 64 65 3a 28 69 6e | 74 29 72 65 74 75 72 6e |Code:(in|t)return|
|00001380| 43 6f 64 65 20 63 6f 6e | 74 65 78 74 49 6e 66 6f |Code con|textInfo|
|00001390| 3a 28 76 6f 69 64 20 2a | 29 63 6f 6e 74 65 78 74 |:(void *|)context|
|000013a0| 49 6e 66 6f 0a 20 20 20 | 20 2f 2f 20 43 61 6c 6c |Info. | // Call|
|000013b0| 65 64 20 77 68 65 6e 20 | 74 68 65 20 50 72 65 66 |ed when |the Pref|
|000013c0| 65 72 65 6e 63 65 73 20 | 73 68 65 65 74 20 65 6e |erences |sheet en|
|000013d0| 64 73 0a 7b 0a 20 20 20 | 20 69 66 20 28 72 65 74 |ds.{. | if (ret|
|000013e0| 75 72 6e 43 6f 64 65 20 | 3d 3d 20 4e 53 4f 4b 42 |urnCode |== NSOKB|
|000013f0| 75 74 74 6f 6e 29 20 7b | 0a 20 20 20 20 20 20 20 |utton) {|. |
|00001400| 20 63 6f 70 79 41 6c 6c | 20 3d 20 5b 63 6f 70 79 | copyAll| = [copy|
|00001410| 41 6c 6c 43 68 65 63 6b | 20 73 74 61 74 65 5d 3b |AllCheck| state];|
|00001420| 0a 20 20 20 20 20 20 20 | 20 5b 73 65 6c 66 20 73 |. | [self s|
|00001430| 65 74 45 76 65 6e 74 54 | 69 74 6c 65 3a 5b 65 76 |etEventT|itle:[ev|
|00001440| 65 6e 74 54 69 74 6c 65 | 46 69 65 6c 64 20 73 74 |entTitle|Field st|
|00001450| 72 69 6e 67 56 61 6c 75 | 65 5d 5d 3b 0a 0a 20 20 |ringValu|e]];.. |
|00001460| 20 20 20 20 20 20 2f 2f | 20 73 61 76 65 20 70 72 | //| save pr|
|00001470| 65 66 73 0a 20 20 20 20 | 20 20 20 20 5b 5b 4e 53 |efs. | [[NS|
|00001480| 55 73 65 72 44 65 66 61 | 75 6c 74 73 20 73 74 61 |UserDefa|ults sta|
|00001490| 6e 64 61 72 64 55 73 65 | 72 44 65 66 61 75 6c 74 |ndardUse|rDefault|
|000014a0| 73 5d 20 73 65 74 4f 62 | 6a 65 63 74 3a 65 76 65 |s] setOb|ject:eve|
|000014b0| 6e 74 54 69 74 6c 65 20 | 66 6f 72 4b 65 79 3a 53 |ntTitle |forKey:S|
|000014c0| 53 5f 49 42 53 5f 45 76 | 65 6e 74 54 69 74 6c 65 |S_IBS_Ev|entTitle|
|000014d0| 5f 4b 65 79 5d 3b 0a 20 | 20 20 20 20 20 20 20 5b |_Key];. | [|
|000014e0| 5b 4e 53 55 73 65 72 44 | 65 66 61 75 6c 74 73 20 |[NSUserD|efaults |
|000014f0| 73 74 61 6e 64 61 72 64 | 55 73 65 72 44 65 66 61 |standard|UserDefa|
|00001500| 75 6c 74 73 5d 20 73 65 | 74 4f 62 6a 65 63 74 3a |ults] se|tObject:|
|00001510| 5b 4e 53 4e 75 6d 62 65 | 72 20 6e 75 6d 62 65 72 |[NSNumbe|r number|
|00001520| 57 69 74 68 42 6f 6f 6c | 3a 63 6f 70 79 41 6c 6c |WithBool|:copyAll|
|00001530| 5d 20 66 6f 72 4b 65 79 | 3a 53 53 5f 49 42 53 5f |] forKey|:SS_IBS_|
|00001540| 43 6f 70 79 41 6c 6c 5f | 4b 65 79 5d 3b 0a 0a 20 |CopyAll_|Key];.. |
|00001550| 20 20 20 20 20 20 20 2f | 2f 20 55 70 64 61 74 65 | /|/ Update|
|00001560| 20 65 6e 61 62 6c 65 64 | 20 73 74 61 74 75 73 20 | enabled| status |
|00001570| 6f 66 20 63 6f 70 79 42 | 75 74 74 6f 6e 0a 20 20 |of copyB|utton. |
|00001580| 20 20 20 20 20 20 5b 73 | 65 6c 66 20 74 61 62 6c | [s|elf tabl|
|00001590| 65 56 69 65 77 53 65 6c | 65 63 74 69 6f 6e 44 69 |eViewSel|ectionDi|
|000015a0| 64 43 68 61 6e 67 65 3a | 6e 69 6c 5d 3b 0a 20 20 |dChange:|nil];. |
|000015b0| 20 20 7d 0a 7d 0a 0a 2d | 20 28 49 42 41 63 74 69 | }.}..-| (IBActi|
|000015c0| 6f 6e 29 73 68 6f 77 53 | 6f 6d 65 48 65 6c 70 3a |on)showS|omeHelp:|
|000015d0| 28 69 64 29 73 65 6e 64 | 65 72 0a 7b 0a 20 20 20 |(id)send|er.{. |
|000015e0| 20 69 6e 74 20 72 65 73 | 75 6c 74 3b 0a 20 20 20 | int res|ult;. |
|000015f0| 20 72 65 73 75 6c 74 20 | 3d 20 4e 53 52 75 6e 41 | result |= NSRunA|
|00001600| 6c 65 72 74 50 61 6e 65 | 6c 28 4e 53 4c 6f 63 61 |lertPane|l(NSLoca|
|00001610| 6c 69 7a 65 64 53 74 72 | 69 6e 67 28 40 22 48 65 |lizedStr|ing(@"He|
|00001620| 6c 70 22 2c 20 6e 69 6c | 29 2c 0a 20 20 20 20 20 |lp", nil|),. |
|00001630| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001640| 20 20 20 20 20 20 20 20 | 5b 5b 4e 53 4c 6f 63 61 | |[[NSLoca|
|00001650| 6c 69 7a 65 64 53 74 72 | 69 6e 67 28 40 22 48 65 |lizedStr|ing(@"He|
|00001660| 6c 70 53 74 72 31 22 2c | 20 6e 69 6c 29 20 73 74 |lpStr1",| nil) st|
|00001670| 72 69 6e 67 42 79 41 70 | 70 65 6e 64 69 6e 67 53 |ringByAp|pendingS|
|00001680| 74 72 69 6e 67 3a 40 22 | 5c 72 5c 72 22 5d 0a 20 |tring:@"|\r\r"]. |
|00001690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000016a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000016b0| 20 20 73 74 72 69 6e 67 | 42 79 41 70 70 65 6e 64 | string|ByAppend|
|000016c0| 69 6e 67 53 74 72 69 6e | 67 3a 4e 53 4c 6f 63 61 |ingStrin|g:NSLoca|
|000016d0| 6c 69 7a 65 64 53 74 72 | 69 6e 67 28 40 22 48 65 |lizedStr|ing(@"He|
|000016e0| 6c 70 53 74 72 32 22 2c | 20 6e 69 6c 29 5d 2c 20 |lpStr2",| nil)], |
|000016f0| 6e 69 6c 2c 20 6e 69 6c | 2c 20 6e 69 6c 29 3b 0a |nil, nil|, nil);.|
|00001700| 7d 0a 0a 2d 20 28 42 4f | 4f 4c 29 76 61 6c 69 64 |}..- (BO|OL)valid|
|00001710| 61 74 65 4d 65 6e 75 49 | 74 65 6d 3a 28 4e 53 4d |ateMenuI|tem:(NSM|
|00001720| 65 6e 75 49 74 65 6d 20 | 2a 29 6d 65 6e 75 49 74 |enuItem |*)menuIt|
|00001730| 65 6d 0a 7b 0a 20 20 20 | 20 69 66 20 28 28 5b 6d |em.{. | if (([m|
|00001740| 65 6e 75 49 74 65 6d 20 | 61 63 74 69 6f 6e 5d 20 |enuItem |action] |
|00001750| 3d 3d 20 40 73 65 6c 65 | 63 74 6f 72 28 73 68 6f |== @sele|ctor(sho|
|00001760| 77 50 72 65 66 73 3a 29 | 29 29 20 7b 0a 20 20 20 |wPrefs:)|)) {. |
|00001770| 20 20 20 20 20 69 66 20 | 28 28 5b 5b 63 6f 70 79 | if |(([[copy|
|00001780| 42 75 74 74 6f 6e 20 77 | 69 6e 64 6f 77 5d 20 61 |Button w|indow] a|
|00001790| 74 74 61 63 68 65 64 53 | 68 65 65 74 5d 20 21 3d |ttachedS|heet] !=|
|000017a0| 20 6e 69 6c 29 20 7c 7c | 20 63 6f 70 79 69 6e 67 | nil) ||| copying|
|000017b0| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|000017c0| 72 65 74 75 72 6e 20 4e | 4f 3b 0a 20 20 20 20 20 |return N|O;. |
|000017d0| 20 20 20 7d 0a 20 20 20 | 20 7d 0a 20 20 20 20 72 | }. | }. r|
|000017e0| 65 74 75 72 6e 20 59 45 | 53 3b 0a 7d 0a 0a 2f 2f |eturn YE|S;.}..//|
|000017f0| 20 61 63 63 65 73 73 6f | 72 73 0a 2d 20 28 76 6f | accesso|rs.- (vo|
|00001800| 69 64 29 73 65 74 45 76 | 65 6e 74 54 69 74 6c 65 |id)setEv|entTitle|
|00001810| 3a 28 4e 53 53 74 72 69 | 6e 67 20 2a 29 6e 65 77 |:(NSStri|ng *)new|
|00001820| 54 69 74 6c 65 0a 7b 0a | 20 20 20 20 5b 6e 65 77 |Title.{.| [new|
|00001830| 54 69 74 6c 65 20 72 65 | 74 61 69 6e 5d 3b 0a 20 |Title re|tain];. |
|00001840| 20 20 20 5b 65 76 65 6e | 74 54 69 74 6c 65 20 72 | [even|tTitle r|
|00001850| 65 6c 65 61 73 65 5d 3b | 0a 20 20 20 20 65 76 65 |elease];|. eve|
|00001860| 6e 74 54 69 74 6c 65 20 | 3d 20 6e 65 77 54 69 74 |ntTitle |= newTit|
|00001870| 6c 65 3b 0a 7d 0a 0a 2d | 20 28 4e 53 41 72 72 61 |le;.}..-| (NSArra|
|00001880| 79 20 2a 29 63 61 6c 4e | 61 6d 65 73 0a 7b 0a 20 |y *)calN|ames.{. |
|00001890| 20 20 20 72 65 74 75 72 | 6e 20 63 61 6c 4e 61 6d | retur|n calNam|
|000018a0| 65 73 3b 0a 7d 0a 0a 2d | 20 28 4e 53 44 69 63 74 |es;.}..-| (NSDict|
|000018b0| 69 6f 6e 61 72 79 20 2a | 29 63 61 6c 65 6e 64 61 |ionary *|)calenda|
|000018c0| 72 73 0a 7b 0a 20 20 20 | 20 72 65 74 75 72 6e 20 |rs.{. | return |
|000018d0| 63 61 6c 65 6e 64 61 72 | 73 3b 0a 7d 0a 0a 2f 2f |calendar|s;.}..//|
|000018e0| 20 77 68 65 72 65 20 74 | 68 65 20 61 63 74 69 6f | where t|he actio|
|000018f0| 6e 20 69 73 0a 2d 20 28 | 49 42 41 63 74 69 6f 6e |n is.- (|IBAction|
|00001900| 29 63 6f 70 79 42 69 72 | 74 68 64 61 79 73 3a 28 |)copyBir|thdays:(|
|00001910| 69 64 29 73 65 6e 64 65 | 72 0a 7b 0a 20 20 20 20 |id)sende|r.{. |
|00001920| 69 66 20 28 63 6f 70 79 | 69 6e 67 29 20 7b 0a 20 |if (copy|ing) {. |
|00001930| 20 20 20 20 20 20 20 5b | 4e 53 41 70 70 20 74 65 | [|NSApp te|
|00001940| 72 6d 69 6e 61 74 65 3a | 6e 69 6c 5d 3b 0a 20 20 |rminate:|nil];. |
|00001950| 20 20 7d 0a 20 20 20 20 | 0a 20 20 20 20 5b 63 6f | }. |. [co|
|00001960| 70 79 42 75 74 74 6f 6e | 20 73 65 74 45 6e 61 62 |pyButton| setEnab|
|00001970| 6c 65 64 3a 4e 4f 5d 3b | 0a 20 20 20 20 5b 70 72 |led:NO];|. [pr|
|00001980| 65 66 73 42 75 74 74 6f | 6e 20 73 65 74 45 6e 61 |efsButto|n setEna|
|00001990| 62 6c 65 64 3a 4e 4f 5d | 3b 0a 20 20 20 20 63 6f |bled:NO]|;. co|
|000019a0| 70 79 69 6e 67 20 3d 20 | 59 45 53 3b 0a 20 20 20 |pying = |YES;. |
|000019b0| 20 5b 70 72 6f 67 72 65 | 73 73 20 73 65 74 55 73 | [progre|ss setUs|
|000019c0| 65 73 54 68 72 65 61 64 | 65 64 41 6e 69 6d 61 74 |esThread|edAnimat|
|000019d0| 69 6f 6e 3a 59 45 53 5d | 3b 0a 20 20 20 20 5b 70 |ion:YES]|;. [p|
|000019e0| 72 6f 67 72 65 73 73 20 | 73 74 61 72 74 41 6e 69 |rogress |startAni|
|000019f0| 6d 61 74 69 6f 6e 3a 6e | 69 6c 5d 3b 0a 20 20 20 |mation:n|il];. |
|00001a00| 20 0a 20 20 20 20 4e 53 | 53 74 72 69 6e 67 20 2a | . NS|String *|
|00001a10| 63 61 6c 54 69 74 6c 65 | 20 3d 20 5b 63 61 6c 4e |calTitle| = [calN|
|00001a20| 61 6d 65 73 20 6f 62 6a | 65 63 74 41 74 49 6e 64 |ames obj|ectAtInd|
|00001a30| 65 78 3a 5b 63 61 6c 54 | 61 62 6c 65 20 73 65 6c |ex:[calT|able sel|
|00001a40| 65 63 74 65 64 52 6f 77 | 5d 5d 3b 0a 20 20 20 20 |ectedRow|]];. |
|00001a50| 4e 53 53 74 72 69 6e 67 | 20 2a 73 63 72 69 70 74 |NSString| *script|
|00001a60| 42 6f 64 79 20 3d 20 5b | 4e 53 53 74 72 69 6e 67 |Body = [|NSString|
|00001a70| 20 73 74 72 69 6e 67 57 | 69 74 68 43 6f 6e 74 65 | stringW|ithConte|
|00001a80| 6e 74 73 4f 66 46 69 6c | 65 3a 5b 5b 4e 53 42 75 |ntsOfFil|e:[[NSBu|
|00001a90| 6e 64 6c 65 20 6d 61 69 | 6e 42 75 6e 64 6c 65 5d |ndle mai|nBundle]|
|00001aa0| 20 70 61 74 68 46 6f 72 | 52 65 73 6f 75 72 63 65 | pathFor|Resource|
|00001ab0| 3a 40 22 6d 61 6b 65 5f | 65 76 65 6e 74 5f 69 63 |:@"make_|event_ic|
|00001ac0| 61 6c 22 20 6f 66 54 79 | 70 65 3a 40 22 74 78 74 |al" ofTy|pe:@"txt|
|00001ad0| 22 5d 5d 3b 0a 20 20 20 | 20 0a 20 20 20 20 4e 53 |"]];. | . NS|
|00001ae0| 45 6e 75 6d 65 72 61 74 | 6f 72 20 2a 65 6e 75 6d |Enumerat|or *enum|
|00001af0| 65 72 61 74 6f 72 20 3d | 20 5b 62 69 72 74 68 64 |erator =| [birthd|
|00001b00| 61 79 50 65 6f 70 6c 65 | 20 6f 62 6a 65 63 74 45 |ayPeople| objectE|
|00001b10| 6e 75 6d 65 72 61 74 6f | 72 5d 3b 0a 20 20 20 20 |numerato|r];. |
|00001b20| 41 42 50 65 72 73 6f 6e | 20 2a 70 65 72 73 6f 6e |ABPerson| *person|
|00001b30| 3b 0a 0a 20 20 20 20 5b | 5b 4e 53 55 73 65 72 44 |;.. [|[NSUserD|
|00001b40| 65 66 61 75 6c 74 73 20 | 73 74 61 6e 64 61 72 64 |efaults |standard|
|00001b50| 55 73 65 72 44 65 66 61 | 75 6c 74 73 5d 20 73 65 |UserDefa|ults] se|
|00001b60| 74 4f 62 6a 65 63 74 3a | 63 61 6c 54 69 74 6c 65 |tObject:|calTitle|
|00001b70| 20 66 6f 72 4b 65 79 3a | 53 53 5f 49 42 53 5f 43 | forKey:|SS_IBS_C|
|00001b80| 61 6c 65 6e 64 61 72 4e | 61 6d 65 5f 4b 65 79 5d |alendarN|ame_Key]|
|00001b90| 3b 20 2f 2f 20 73 61 76 | 65 20 6e 61 6d 65 20 6f |; // sav|e name o|
|00001ba0| 66 20 6c 61 73 74 20 73 | 65 6c 65 63 74 65 64 20 |f last s|elected |
|00001bb0| 63 61 6c 65 6e 64 61 72 | 0a 20 20 20 20 0a 20 20 |calendar|. . |
|00001bc0| 20 20 77 68 69 6c 65 20 | 28 70 65 72 73 6f 6e 20 | while |(person |
|00001bd0| 3d 20 5b 65 6e 75 6d 65 | 72 61 74 6f 72 20 6e 65 |= [enume|rator ne|
|00001be0| 78 74 4f 62 6a 65 63 74 | 5d 29 20 7b 0a 20 20 20 |xtObject|]) {. |
|00001bf0| 20 20 20 20 20 69 66 20 | 28 63 6f 70 79 41 6c 6c | if |(copyAll|
|00001c00| 20 7c 7c 20 28 5b 70 65 | 72 73 6f 6e 20 76 61 6c | || ([pe|rson val|
|00001c10| 75 65 46 6f 72 50 72 6f | 70 65 72 74 79 3a 53 53 |ueForPro|perty:SS|
|00001c20| 5f 49 42 53 5f 42 64 61 | 79 41 64 64 65 64 44 61 |_IBS_Bda|yAddedDa|
|00001c30| 74 65 5f 50 72 6f 70 5d | 20 3d 3d 20 6e 69 6c 29 |te_Prop]| == nil)|
|00001c40| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|00001c50| 4e 53 4d 75 74 61 62 6c | 65 53 74 72 69 6e 67 20 |NSMutabl|eString |
|00001c60| 2a 68 65 61 64 65 72 54 | 65 78 74 20 3d 20 5b 4e |*headerT|ext = [N|
|00001c70| 53 4d 75 74 61 62 6c 65 | 53 74 72 69 6e 67 20 73 |SMutable|String s|
|00001c80| 74 72 69 6e 67 5d 3b 0a | 0a 20 20 20 20 20 20 20 |tring];.|. |
|00001c90| 20 20 20 20 20 5b 68 65 | 61 64 65 72 54 65 78 74 | [he|aderText|
|00001ca0| 20 61 70 70 65 6e 64 53 | 74 72 69 6e 67 3a 5b 4e | appendS|tring:[N|
|00001cb0| 53 53 74 72 69 6e 67 20 | 73 74 72 69 6e 67 57 69 |SString |stringWi|
|00001cc0| 74 68 46 6f 72 6d 61 74 | 3a 40 22 73 65 74 20 63 |thFormat|:@"set c|
|00001cd0| 61 6c 54 69 74 6c 65 20 | 74 6f 20 5c 22 25 40 5c |alTitle |to \"%@\|
|00001ce0| 22 5c 72 22 2c 20 63 61 | 6c 54 69 74 6c 65 5d 5d |"\r", ca|lTitle]]|
|00001cf0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 0a 20 |;. | . |
|00001d00| 20 20 20 20 20 20 20 20 | 20 20 20 4e 53 4d 75 74 | | NSMut|
|00001d10| 61 62 6c 65 53 74 72 69 | 6e 67 20 2a 65 76 65 6e |ableStri|ng *even|
|00001d20| 74 54 69 74 6c 65 46 69 | 6e 61 6c 20 3d 20 5b 4e |tTitleFi|nal = [N|
|00001d30| 53 4d 75 74 61 62 6c 65 | 53 74 72 69 6e 67 20 73 |SMutable|String s|
|00001d40| 74 72 69 6e 67 57 69 74 | 68 53 74 72 69 6e 67 3a |tringWit|hString:|
|00001d50| 65 76 65 6e 74 54 69 74 | 6c 65 5d 3b 0a 0a 20 20 |eventTit|le];.. |
|00001d60| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 57 65 20 | | // We |
|00001d70| 6e 6f 77 20 63 68 65 63 | 6b 20 28 61 73 20 6f 66 |now chec|k (as of|
|00001d80| 20 76 31 2e 31 2e 31 29 | 20 77 68 65 74 68 65 72 | v1.1.1)| whether|
|00001d90| 20 66 69 72 73 74 20 6e | 61 6d 65 20 6f 72 20 6c | first n|ame or l|
|00001da0| 61 73 74 20 6e 61 6d 65 | 20 61 72 65 20 6e 69 6c |ast name| are nil|
|00001db0| 20 62 65 66 6f 72 65 20 | 74 72 79 69 6e 67 20 72 | before |trying r|
|00001dc0| 65 70 6c 61 63 65 4f 63 | 63 75 72 72 65 6e 63 65 |eplaceOc|currence|
|00001dd0| 73 4f 66 53 74 72 69 6e | 67 3a 2e 0a 20 20 20 20 |sOfStrin|g:.. |
|00001de0| 20 20 20 20 20 20 20 20 | 2f 2f 20 4e 6f 74 20 63 | |// Not c|
|00001df0| 68 65 63 6b 69 6e 67 20 | 77 61 73 20 74 68 65 20 |hecking |was the |
|00001e00| 63 61 75 73 65 20 6f 66 | 20 74 68 65 20 22 65 6e |cause of| the "en|
|00001e10| 64 6c 65 73 73 20 73 70 | 69 6e 6e 69 6e 67 22 20 |dless sp|inning" |
|00001e20| 62 75 67 20 69 6e 20 76 | 65 72 73 69 6f 6e 20 31 |bug in v|ersion 1|
|00001e30| 2e 31 2c 20 62 65 63 61 | 75 73 65 20 77 68 65 6e |.1, beca|use when|
|00001e40| 20 79 6f 75 20 73 75 70 | 70 6c 79 20 61 0a 20 20 | you sup|ply a. |
|00001e50| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 6e 69 6c | | // nil|
|00001e60| 20 61 72 67 75 6d 65 6e | 74 20 74 6f 20 72 65 70 | argumen|t to rep|
|00001e70| 6c 61 63 65 4f 63 63 75 | 72 72 65 6e 63 65 73 4f |laceOccu|rrencesO|
|00001e80| 66 53 74 72 69 6e 67 3a | 2c 20 79 6f 75 20 67 65 |fString:|, you ge|
|00001e90| 74 20 61 6e 20 4e 53 49 | 6e 76 61 6c 69 64 41 72 |t an NSI|nvalidAr|
|00001ea0| 67 75 6d 65 6e 74 45 78 | 63 65 70 74 69 6f 6e 2e |gumentEx|ception.|
|00001eb0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|00001ec0| 28 5b 70 65 72 73 6f 6e | 20 76 61 6c 75 65 46 6f |([person| valueFo|
|00001ed0| 72 50 72 6f 70 65 72 74 | 79 3a 6b 41 42 46 69 72 |rPropert|y:kABFir|
|00001ee0| 73 74 4e 61 6d 65 50 72 | 6f 70 65 72 74 79 5d 20 |stNamePr|operty] |
|00001ef0| 21 3d 20 6e 69 6c 29 20 | 7b 0a 20 20 20 20 20 20 |!= nil) |{. |
|00001f00| 20 20 20 20 20 20 20 20 | 20 20 5b 65 76 65 6e 74 | | [event|
|00001f10| 54 69 74 6c 65 46 69 6e | 61 6c 20 72 65 70 6c 61 |TitleFin|al repla|
|00001f20| 63 65 4f 63 63 75 72 72 | 65 6e 63 65 73 4f 66 53 |ceOccurr|encesOfS|
|00001f30| 74 72 69 6e 67 3a 40 22 | 25 66 6e 22 20 77 69 74 |tring:@"|%fn" wit|
|00001f40| 68 53 74 72 69 6e 67 3a | 5b 70 65 72 73 6f 6e 20 |hString:|[person |
|00001f50| 76 61 6c 75 65 46 6f 72 | 50 72 6f 70 65 72 74 79 |valueFor|Property|
|00001f60| 3a 6b 41 42 46 69 72 73 | 74 4e 61 6d 65 50 72 6f |:kABFirs|tNamePro|
|00001f70| 70 65 72 74 79 5d 0a 20 | 20 20 20 20 20 20 20 20 |perty]. | |
|00001f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001fa0| 20 20 20 20 20 20 20 20 | 20 20 20 6f 70 74 69 6f | | optio|
|00001fb0| 6e 73 3a 4e 53 43 61 73 | 65 49 6e 73 65 6e 73 69 |ns:NSCas|eInsensi|
|00001fc0| 74 69 76 65 53 65 61 72 | 63 68 20 72 61 6e 67 65 |tiveSear|ch range|
|00001fd0| 3a 4e 53 4d 61 6b 65 52 | 61 6e 67 65 28 30 2c 20 |:NSMakeR|ange(0, |
|00001fe0| 5b 65 76 65 6e 74 54 69 | 74 6c 65 46 69 6e 61 6c |[eventTi|tleFinal|
|00001ff0| 20 6c 65 6e 67 74 68 5d | 29 5d 3b 0a 20 20 20 20 | length]|)];. |
|00002000| 20 20 20 20 20 20 20 20 | 7d 20 65 6c 73 65 20 7b | |} else {|
|00002010| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002020| 20 5b 65 76 65 6e 74 54 | 69 74 6c 65 46 69 6e 61 | [eventT|itleFina|
|00002030| 6c 20 72 65 70 6c 61 63 | 65 4f 63 63 75 72 72 65 |l replac|eOccurre|
|00002040| 6e 63 65 73 4f 66 53 74 | 72 69 6e 67 3a 40 22 25 |ncesOfSt|ring:@"%|
|00002050| 66 6e 22 20 77 69 74 68 | 53 74 72 69 6e 67 3a 40 |fn" with|String:@|
|00002060| 22 22 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |"". | |
|00002070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002090| 20 20 20 20 20 20 20 6f | 70 74 69 6f 6e 73 3a 4e | o|ptions:N|
|000020a0| 53 43 61 73 65 49 6e 73 | 65 6e 73 69 74 69 76 65 |SCaseIns|ensitive|
|000020b0| 53 65 61 72 63 68 20 72 | 61 6e 67 65 3a 4e 53 4d |Search r|ange:NSM|
|000020c0| 61 6b 65 52 61 6e 67 65 | 28 30 2c 20 5b 65 76 65 |akeRange|(0, [eve|
|000020d0| 6e 74 54 69 74 6c 65 46 | 69 6e 61 6c 20 6c 65 6e |ntTitleF|inal len|
|000020e0| 67 74 68 5d 29 5d 3b 0a | 20 20 20 20 20 20 20 20 |gth])];.| |
|000020f0| 20 20 20 20 7d 0a 0a 20 | 20 20 20 20 20 20 20 20 | }.. | |
|00002100| 20 20 20 69 66 20 28 5b | 70 65 72 73 6f 6e 20 76 | if ([|person v|
|00002110| 61 6c 75 65 46 6f 72 50 | 72 6f 70 65 72 74 79 3a |alueForP|roperty:|
|00002120| 6b 41 42 4c 61 73 74 4e | 61 6d 65 50 72 6f 70 65 |kABLastN|amePrope|
|00002130| 72 74 79 5d 20 21 3d 20 | 6e 69 6c 29 20 7b 0a 20 |rty] != |nil) {. |
|00002140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5b | | [|
|00002150| 65 76 65 6e 74 54 69 74 | 6c 65 46 69 6e 61 6c 20 |eventTit|leFinal |
|00002160| 72 65 70 6c 61 63 65 4f | 63 63 75 72 72 65 6e 63 |replaceO|ccurrenc|
|00002170| 65 73 4f 66 53 74 72 69 | 6e 67 3a 40 22 25 6c 6e |esOfStri|ng:@"%ln|
|00002180| 22 20 77 69 74 68 53 74 | 72 69 6e 67 3a 5b 70 65 |" withSt|ring:[pe|
|00002190| 72 73 6f 6e 20 76 61 6c | 75 65 46 6f 72 50 72 6f |rson val|ueForPro|
|000021a0| 70 65 72 74 79 3a 6b 41 | 42 4c 61 73 74 4e 61 6d |perty:kA|BLastNam|
|000021b0| 65 50 72 6f 70 65 72 74 | 79 5d 0a 20 20 20 20 20 |ePropert|y]. |
|000021c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6f | | o|
|000021f0| 70 74 69 6f 6e 73 3a 4e | 53 43 61 73 65 49 6e 73 |ptions:N|SCaseIns|
|00002200| 65 6e 73 69 74 69 76 65 | 53 65 61 72 63 68 20 72 |ensitive|Search r|
|00002210| 61 6e 67 65 3a 4e 53 4d | 61 6b 65 52 61 6e 67 65 |ange:NSM|akeRange|
|00002220| 28 30 2c 20 5b 65 76 65 | 6e 74 54 69 74 6c 65 46 |(0, [eve|ntTitleF|
|00002230| 69 6e 61 6c 20 6c 65 6e | 67 74 68 5d 29 5d 3b 0a |inal len|gth])];.|
|00002240| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 20 65 6c | | } el|
|00002250| 73 65 20 7b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |se {. | |
|00002260| 20 20 20 20 20 5b 65 76 | 65 6e 74 54 69 74 6c 65 | [ev|entTitle|
|00002270| 46 69 6e 61 6c 20 72 65 | 70 6c 61 63 65 4f 63 63 |Final re|placeOcc|
|00002280| 75 72 72 65 6e 63 65 73 | 4f 66 53 74 72 69 6e 67 |urrences|OfString|
|00002290| 3a 40 22 25 6c 6e 22 20 | 77 69 74 68 53 74 72 69 |:@"%ln" |withStri|
|000022a0| 6e 67 3a 40 22 22 0a 20 | 20 20 20 20 20 20 20 20 |ng:@"". | |
|000022b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000022c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000022d0| 20 20 20 20 20 20 20 20 | 20 20 20 6f 70 74 69 6f | | optio|
|000022e0| 6e 73 3a 4e 53 43 61 73 | 65 49 6e 73 65 6e 73 69 |ns:NSCas|eInsensi|
|000022f0| 74 69 76 65 53 65 61 72 | 63 68 20 72 61 6e 67 65 |tiveSear|ch range|
|00002300| 3a 4e 53 4d 61 6b 65 52 | 61 6e 67 65 28 30 2c 20 |:NSMakeR|ange(0, |
|00002310| 5b 65 76 65 6e 74 54 69 | 74 6c 65 46 69 6e 61 6c |[eventTi|tleFinal|
|00002320| 20 6c 65 6e 67 74 68 5d | 29 5d 3b 0a 20 20 20 20 | length]|)];. |
|00002330| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00002340| 20 20 20 20 20 20 0a 20 | 20 20 20 20 20 20 20 20 | . | |
|00002350| 20 20 20 5b 68 65 61 64 | 65 72 54 65 78 74 20 61 | [head|erText a|
|00002360| 70 70 65 6e 64 53 74 72 | 69 6e 67 3a 5b 4e 53 53 |ppendStr|ing:[NSS|
|00002370| 74 72 69 6e 67 20 73 74 | 72 69 6e 67 57 69 74 68 |tring st|ringWith|
|00002380| 46 6f 72 6d 61 74 3a 40 | 22 73 65 74 20 65 76 65 |Format:@|"set eve|
|00002390| 6e 74 54 69 74 6c 65 20 | 74 6f 20 5c 22 25 40 5c |ntTitle |to \"%@\|
|000023a0| 22 5c 72 22 2c 20 65 76 | 65 6e 74 54 69 74 6c 65 |"\r", ev|entTitle|
|000023b0| 46 69 6e 61 6c 5d 5d 3b | 0a 20 20 20 20 20 20 20 |Final]];|. |
|000023c0| 20 20 20 20 20 0a 20 20 | 20 20 20 20 20 20 20 20 | . | |
|000023d0| 20 20 4e 53 43 61 6c 65 | 6e 64 61 72 44 61 74 65 | NSCale|ndarDate|
|000023e0| 20 2a 62 69 72 74 68 64 | 61 79 20 3d 20 5b 70 65 | *birthd|ay = [pe|
|000023f0| 72 73 6f 6e 20 76 61 6c | 75 65 46 6f 72 50 72 6f |rson val|ueForPro|
|00002400| 70 65 72 74 79 3a 6b 41 | 42 42 69 72 74 68 64 61 |perty:kA|BBirthda|
|00002410| 79 50 72 6f 70 65 72 74 | 79 5d 3b 0a 20 20 20 20 |yPropert|y];. |
|00002420| 20 20 20 20 20 20 20 20 | 5b 68 65 61 64 65 72 54 | |[headerT|
|00002430| 65 78 74 20 61 70 70 65 | 6e 64 53 74 72 69 6e 67 |ext appe|ndString|
|00002440| 3a 5b 4e 53 53 74 72 69 | 6e 67 20 73 74 72 69 6e |:[NSStri|ng strin|
|00002450| 67 57 69 74 68 46 6f 72 | 6d 61 74 3a 40 22 73 65 |gWithFor|mat:@"se|
|00002460| 74 20 65 76 65 6e 74 44 | 61 79 20 74 6f 20 25 64 |t eventD|ay to %d|
|00002470| 5c 72 22 2c 20 5b 62 69 | 72 74 68 64 61 79 20 64 |\r", [bi|rthday d|
|00002480| 61 79 4f 66 4d 6f 6e 74 | 68 5d 5d 5d 3b 0a 20 20 |ayOfMont|h]]];. |
|00002490| 20 20 20 20 20 20 20 20 | 20 20 5b 68 65 61 64 65 | | [heade|
|000024a0| 72 54 65 78 74 20 61 70 | 70 65 6e 64 53 74 72 69 |rText ap|pendStri|
|000024b0| 6e 67 3a 5b 4e 53 53 74 | 72 69 6e 67 20 73 74 72 |ng:[NSSt|ring str|
|000024c0| 69 6e 67 57 69 74 68 46 | 6f 72 6d 61 74 3a 40 22 |ingWithF|ormat:@"|
|000024d0| 73 65 74 20 65 76 65 6e | 74 4d 6f 6e 74 68 20 74 |set even|tMonth t|
|000024e0| 6f 20 25 40 5c 72 22 2c | 20 5b 62 69 72 74 68 64 |o %@\r",| [birthd|
|000024f0| 61 79 20 64 65 73 63 72 | 69 70 74 69 6f 6e 57 69 |ay descr|iptionWi|
|00002500| 74 68 43 61 6c 65 6e 64 | 61 72 46 6f 72 6d 61 74 |thCalend|arFormat|
|00002510| 3a 40 22 25 42 22 5d 5d | 5d 3b 0a 20 20 20 20 20 |:@"%B"]]|];. |
|00002520| 20 20 20 20 20 20 20 5b | 68 65 61 64 65 72 54 65 | [|headerTe|
|00002530| 78 74 20 61 70 70 65 6e | 64 53 74 72 69 6e 67 3a |xt appen|dString:|
|00002540| 5b 4e 53 53 74 72 69 6e | 67 20 73 74 72 69 6e 67 |[NSStrin|g string|
|00002550| 57 69 74 68 46 6f 72 6d | 61 74 3a 40 22 73 65 74 |WithForm|at:@"set|
|00002560| 20 65 76 65 6e 74 4d 6f | 6e 74 68 4e 75 6d 20 74 | eventMo|nthNum t|
|00002570| 6f 20 25 64 5c 72 22 2c | 20 5b 62 69 72 74 68 64 |o %d\r",| [birthd|
|00002580| 61 79 20 6d 6f 6e 74 68 | 4f 66 59 65 61 72 5d 5d |ay month|OfYear]]|
|00002590| 5d 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 0a |];. | .|
|000025a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 57 | | // W|
|000025b0| 65 20 6e 6f 77 20 63 72 | 65 61 74 65 20 62 69 72 |e now cr|eate bir|
|000025c0| 74 68 64 61 79 73 20 73 | 74 61 72 74 69 6e 67 20 |thdays s|tarting |
|000025d0| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 79 |in the c|urrent y|
|000025e0| 65 61 72 2c 20 74 6f 20 | 61 76 6f 69 64 20 6c 6f |ear, to |avoid lo|
|000025f0| 74 73 20 6f 66 20 65 76 | 65 6e 74 73 20 69 6e 20 |ts of ev|ents in |
|00002600| 74 68 65 20 70 61 73 74 | 2e 0a 20 20 20 20 20 20 |the past|.. |
|00002610| 20 20 20 20 20 20 2f 2f | 20 49 66 20 79 6f 75 20 | //| If you |
|00002620| 70 72 65 66 65 72 20 74 | 68 65 20 6f 6c 64 20 62 |prefer t|he old b|
|00002630| 65 68 61 76 69 6f 75 72 | 2c 20 63 68 61 6e 67 65 |ehaviour|, change|
|00002640| 20 22 5b 4e 53 43 61 6c | 65 6e 64 61 72 44 61 74 | "[NSCal|endarDat|
|00002650| 65 20 63 61 6c 65 6e 64 | 61 72 44 61 74 65 5d 22 |e calend|arDate]"|
|00002660| 20 74 6f 20 22 62 69 72 | 74 68 64 61 79 22 20 69 | to "bir|thday" i|
|00002670| 6e 20 74 68 65 20 6e 65 | 78 74 20 6c 69 6e 65 2e |n the ne|xt line.|
|00002680| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 5b 68 65 |. | [he|
|00002690| 61 64 65 72 54 65 78 74 | 20 61 70 70 65 6e 64 53 |aderText| appendS|
|000026a0| 74 72 69 6e 67 3a 5b 4e | 53 53 74 72 69 6e 67 20 |tring:[N|SString |
|000026b0| 73 74 72 69 6e 67 57 69 | 74 68 46 6f 72 6d 61 74 |stringWi|thFormat|
|000026c0| 3a 40 22 73 65 74 20 65 | 76 65 6e 74 59 65 61 72 |:@"set e|ventYear|
|000026d0| 20 74 6f 20 25 64 5c 72 | 22 2c 20 5b 5b 4e 53 43 | to %d\r|", [[NSC|
|000026e0| 61 6c 65 6e 64 61 72 44 | 61 74 65 20 63 61 6c 65 |alendarD|ate cale|
|000026f0| 6e 64 61 72 44 61 74 65 | 5d 20 79 65 61 72 4f 66 |ndarDate|] yearOf|
|00002700| 43 6f 6d 6d 6f 6e 45 72 | 61 5d 5d 5d 3b 0a 20 20 |CommonEr|a]]];. |
|00002710| 20 20 20 20 20 20 20 20 | 20 20 0a 20 20 20 20 20 | | . |
|00002720| 20 20 20 20 20 20 20 5b | 68 65 61 64 65 72 54 65 | [|headerTe|
|00002730| 78 74 20 61 70 70 65 6e | 64 53 74 72 69 6e 67 3a |xt appen|dString:|
|00002740| 73 63 72 69 70 74 42 6f | 64 79 5d 3b 0a 0a 20 20 |scriptBo|dy];.. |
|00002750| 20 20 20 20 20 20 20 20 | 20 20 4e 53 41 70 70 6c | | NSAppl|
|00002760| 65 53 63 72 69 70 74 20 | 2a 73 63 72 69 70 74 20 |eScript |*script |
|00002770| 3d 20 5b 5b 4e 53 41 70 | 70 6c 65 53 63 72 69 70 |= [[NSAp|pleScrip|
|00002780| 74 20 61 6c 6c 6f 63 5d | 20 69 6e 69 74 57 69 74 |t alloc]| initWit|
|00002790| 68 53 6f 75 72 63 65 3a | 68 65 61 64 65 72 54 65 |hSource:|headerTe|
|000027a0| 78 74 5d 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |xt];. | |
|000027b0| 20 4e 53 44 69 63 74 69 | 6f 6e 61 72 79 20 2a 65 | NSDicti|onary *e|
|000027c0| 72 72 6f 72 49 6e 66 6f | 20 3d 20 5b 4e 53 44 69 |rrorInfo| = [NSDi|
|000027d0| 63 74 69 6f 6e 61 72 79 | 20 64 69 63 74 69 6f 6e |ctionary| diction|
|000027e0| 61 72 79 5d 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |ary];. | |
|000027f0| 20 20 4e 53 41 70 70 6c | 65 45 76 65 6e 74 44 65 | NSAppl|eEventDe|
|00002800| 73 63 72 69 70 74 6f 72 | 20 2a 64 65 73 63 72 69 |scriptor| *descri|
|00002810| 70 74 6f 72 20 3d 20 5b | 73 63 72 69 70 74 20 65 |ptor = [|script e|
|00002820| 78 65 63 75 74 65 41 6e | 64 52 65 74 75 72 6e 45 |xecuteAn|dReturnE|
|00002830| 72 72 6f 72 3a 26 65 72 | 72 6f 72 49 6e 66 6f 5d |rror:&er|rorInfo]|
|00002840| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 5b 73 |;. | [s|
|00002850| 63 72 69 70 74 20 72 65 | 6c 65 61 73 65 5d 3b 0a |cript re|lease];.|
|00002860| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00002870| 64 65 73 63 72 69 70 74 | 6f 72 20 3d 3d 20 6e 69 |descript|or == ni|
|00002880| 6c 29 20 7b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |l) {. | |
|00002890| 20 20 20 20 20 4e 53 42 | 65 65 70 28 29 3b 0a 20 | NSB|eep();. |
|000028a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5b | | [|
|000028b0| 70 72 6f 67 72 65 73 73 | 20 73 74 6f 70 41 6e 69 |progress| stopAni|
|000028c0| 6d 61 74 69 6f 6e 3a 6e | 69 6c 5d 3b 0a 20 20 20 |mation:n|il];. |
|000028d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5b 63 6f | | [co|
|000028e0| 70 79 42 75 74 74 6f 6e | 20 73 65 74 45 6e 61 62 |pyButton| setEnab|
|000028f0| 6c 65 64 3a 59 45 53 5d | 3b 0a 20 20 20 20 20 20 |led:YES]|;. |
|00002900| 20 20 20 20 20 20 20 20 | 20 20 63 6f 70 79 69 6e | | copyin|
|00002910| 67 20 3d 20 4e 4f 3b 0a | 20 20 20 20 20 20 20 20 |g = NO;.| |
|00002920| 20 20 20 20 20 20 20 20 | 0a 20 20 20 20 20 20 20 | |. |
|00002930| 20 20 20 20 20 20 20 20 | 20 69 66 20 28 5b 65 72 | | if ([er|
|00002940| 72 6f 72 49 6e 66 6f 20 | 6f 62 6a 65 63 74 46 6f |rorInfo |objectFo|
|00002950| 72 4b 65 79 3a 4e 53 41 | 70 70 6c 65 53 63 72 69 |rKey:NSA|ppleScri|
|00002960| 70 74 45 72 72 6f 72 4d | 65 73 73 61 67 65 5d 20 |ptErrorM|essage] |
|00002970| 21 3d 20 6e 69 6c 29 20 | 7b 0a 20 20 20 20 20 20 |!= nil) |{. |
|00002980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 4e 53 | | NS|
|00002990| 42 65 67 69 6e 43 72 69 | 74 69 63 61 6c 41 6c 65 |BeginCri|ticalAle|
|000029a0| 72 74 53 68 65 65 74 28 | 4e 53 4c 6f 63 61 6c 69 |rtSheet(|NSLocali|
|000029b0| 7a 65 64 53 74 72 69 6e | 67 28 40 22 45 72 72 6f |zedStrin|g(@"Erro|
|000029c0| 72 22 2c 20 6e 69 6c 29 | 2c 20 6e 69 6c 2c 20 6e |r", nil)|, nil, n|
|000029d0| 69 6c 2c 20 6e 69 6c 2c | 20 5b 63 6f 70 79 42 75 |il, nil,| [copyBu|
|000029e0| 74 74 6f 6e 20 77 69 6e | 64 6f 77 5d 2c 20 73 65 |tton win|dow], se|
|000029f0| 6c 66 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 6e 69 |lf, nil,| nil, ni|
|00002a00| 6c 2c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |l,. | |
|00002a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a30| 20 5b 65 72 72 6f 72 49 | 6e 66 6f 20 6f 62 6a 65 | [errorI|nfo obje|
|00002a40| 63 74 46 6f 72 4b 65 79 | 3a 4e 53 41 70 70 6c 65 |ctForKey|:NSApple|
|00002a50| 53 63 72 69 70 74 45 72 | 72 6f 72 4d 65 73 73 61 |ScriptEr|rorMessa|
|00002a60| 67 65 5d 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |ge]);. | |
|00002a70| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00002a80| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 3b 0a | |return;.|
|00002a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0a 20 20 | | }. |
|00002aa0| 20 20 20 20 20 20 20 20 | 20 20 5b 70 65 72 73 6f | | [perso|
|00002ab0| 6e 20 73 65 74 56 61 6c | 75 65 3a 5b 4e 53 43 61 |n setVal|ue:[NSCa|
|00002ac0| 6c 65 6e 64 61 72 44 61 | 74 65 20 63 61 6c 65 6e |lendarDa|te calen|
|00002ad0| 64 61 72 44 61 74 65 5d | 20 66 6f 72 50 72 6f 70 |darDate]| forProp|
|00002ae0| 65 72 74 79 3a 53 53 5f | 49 42 53 5f 42 64 61 79 |erty:SS_|IBS_Bday|
|00002af0| 41 64 64 65 64 44 61 74 | 65 5f 50 72 6f 70 5d 3b |AddedDat|e_Prop];|
|00002b00| 0a 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 7d |. | }. }|
|00002b10| 0a 20 20 20 20 69 66 20 | 28 5b 5b 41 42 41 64 64 |. if |([[ABAdd|
|00002b20| 72 65 73 73 42 6f 6f 6b | 20 73 68 61 72 65 64 41 |ressBook| sharedA|
|00002b30| 64 64 72 65 73 73 42 6f | 6f 6b 5d 20 68 61 73 55 |ddressBo|ok] hasU|
|00002b40| 6e 73 61 76 65 64 43 68 | 61 6e 67 65 73 5d 29 20 |nsavedCh|anges]) |
|00002b50| 7b 0a 20 20 20 20 20 20 | 20 20 5b 5b 41 42 41 64 |{. | [[ABAd|
|00002b60| 64 72 65 73 73 42 6f 6f | 6b 20 73 68 61 72 65 64 |dressBoo|k shared|
|00002b70| 41 64 64 72 65 73 73 42 | 6f 6f 6b 5d 20 73 61 76 |AddressB|ook] sav|
|00002b80| 65 5d 3b 20 2f 2f 20 63 | 6f 6d 6d 69 74 20 63 68 |e]; // c|ommit ch|
|00002b90| 61 6e 67 65 73 20 74 6f | 20 64 69 73 6b 20 2d 20 |anges to| disk - |
|00002ba0| 6f 74 68 65 72 77 69 73 | 65 20 74 68 65 79 20 77 |otherwis|e they w|
|00002bb0| 69 6c 6c 20 62 65 20 6c | 6f 73 74 21 0a 20 20 20 |ill be l|ost!. |
|00002bc0| 20 7d 0a 20 20 20 20 0a | 20 20 20 20 5b 70 72 6f | }. .| [pro|
|00002bd0| 67 72 65 73 73 20 73 74 | 6f 70 41 6e 69 6d 61 74 |gress st|opAnimat|
|00002be0| 69 6f 6e 3a 6e 69 6c 5d | 3b 0a 20 20 20 20 5b 62 |ion:nil]|;. [b|
|00002bf0| 69 72 74 68 64 61 79 73 | 43 6f 75 6e 74 46 69 65 |irthdays|CountFie|
|00002c00| 6c 64 20 73 65 74 53 74 | 72 69 6e 67 56 61 6c 75 |ld setSt|ringValu|
|00002c10| 65 3a 4e 53 4c 6f 63 61 | 6c 69 7a 65 64 53 74 72 |e:NSLoca|lizedStr|
|00002c20| 69 6e 67 28 40 22 53 75 | 63 63 65 73 73 53 74 72 |ing(@"Su|ccessStr|
|00002c30| 22 2c 20 6e 69 6c 29 5d | 3b 0a 20 20 20 20 5b 63 |", nil)]|;. [c|
|00002c40| 6f 70 79 42 75 74 74 6f | 6e 20 73 65 74 54 69 74 |opyButto|n setTit|
|00002c50| 6c 65 3a 4e 53 4c 6f 63 | 61 6c 69 7a 65 64 53 74 |le:NSLoc|alizedSt|
|00002c60| 72 69 6e 67 28 40 22 51 | 75 69 74 22 2c 20 6e 69 |ring(@"Q|uit", ni|
|00002c70| 6c 29 5d 3b 0a 20 20 20 | 20 5b 63 6f 70 79 42 75 |l)];. | [copyBu|
|00002c80| 74 74 6f 6e 20 73 65 74 | 45 6e 61 62 6c 65 64 3a |tton set|Enabled:|
|00002c90| 59 45 53 5d 3b 0a 7d 0a | 0a 2d 20 28 4e 53 44 69 |YES];.}.|.- (NSDi|
|00002ca0| 63 74 69 6f 6e 61 72 79 | 20 2a 29 67 65 74 43 61 |ctionary| *)getCa|
|00002cb0| 6c 65 6e 64 61 72 73 0a | 7b 0a 20 20 20 20 4e 53 |lendars.|{. NS|
|00002cc0| 44 69 63 74 69 6f 6e 61 | 72 79 20 2a 70 72 65 66 |Dictiona|ry *pref|
|00002cd0| 73 20 3d 20 5b 4e 53 44 | 69 63 74 69 6f 6e 61 72 |s = [NSD|ictionar|
|00002ce0| 79 20 64 69 63 74 69 6f | 6e 61 72 79 57 69 74 68 |y dictio|naryWith|
|00002cf0| 43 6f 6e 74 65 6e 74 73 | 4f 66 46 69 6c 65 3a 0a |Contents|OfFile:.|
|00002d00| 20 20 20 20 20 20 20 20 | 5b 40 22 7e 2f 4c 69 62 | |[@"~/Lib|
|00002d10| 72 61 72 79 2f 50 72 65 | 66 65 72 65 6e 63 65 73 |rary/Pre|ferences|
|00002d20| 2f 63 6f 6d 2e 61 70 70 | 6c 65 2e 69 43 61 6c 2e |/com.app|le.iCal.|
|00002d30| 73 6f 75 72 63 65 73 2e | 70 6c 69 73 74 22 20 73 |sources.|plist" s|
|00002d40| 74 72 69 6e 67 42 79 45 | 78 70 61 6e 64 69 6e 67 |tringByE|xpanding|
|00002d50| 54 69 6c 64 65 49 6e 50 | 61 74 68 5d 5d 3b 0a 20 |TildeInP|ath]];. |
|00002d60| 20 20 20 0a 20 20 20 20 | 69 66 20 28 70 72 65 66 | . |if (pref|
|00002d70| 73 20 21 3d 20 6e 69 6c | 29 20 7b 0a 20 20 20 20 |s != nil|) {. |
|00002d80| 20 20 20 20 4e 53 44 69 | 63 74 69 6f 6e 61 72 79 | NSDi|ctionary|
|00002d90| 20 2a 63 61 6c 73 20 3d | 20 5b 70 72 65 66 73 20 | *cals =| [prefs |
|00002da0| 6f 62 6a 65 63 74 46 6f | 72 4b 65 79 3a 40 22 53 |objectFo|rKey:@"S|
|00002db0| 6f 75 72 63 65 73 56 69 | 65 77 22 5d 3b 0a 20 20 |ourcesVi|ew"];. |
|00002dc0| 20 20 20 20 20 20 69 66 | 20 28 63 61 6c 73 20 21 | if| (cals !|
|00002dd0| 3d 20 6e 69 6c 29 20 7b | 0a 20 20 20 20 20 20 20 |= nil) {|. |
|00002de0| 20 20 20 20 20 4e 53 4d | 75 74 61 62 6c 65 44 69 | NSM|utableDi|
|00002df0| 63 74 69 6f 6e 61 72 79 | 20 2a 6f 75 74 70 75 74 |ctionary| *output|
|00002e00| 20 3d 20 5b 4e 53 4d 75 | 74 61 62 6c 65 44 69 63 | = [NSMu|tableDic|
|00002e10| 74 69 6f 6e 61 72 79 20 | 64 69 63 74 69 6f 6e 61 |tionary |dictiona|
|00002e20| 72 79 57 69 74 68 43 61 | 70 61 63 69 74 79 3a 5b |ryWithCa|pacity:[|
|00002e30| 63 61 6c 73 20 63 6f 75 | 6e 74 5d 5d 3b 0a 20 20 |cals cou|nt]];. |
|00002e40| 20 20 20 20 20 20 20 20 | 20 20 4e 53 45 6e 75 6d | | NSEnum|
|00002e50| 65 72 61 74 6f 72 20 2a | 65 6e 75 6d 65 72 61 74 |erator *|enumerat|
|00002e60| 6f 72 20 3d 20 5b 63 61 | 6c 73 20 6f 62 6a 65 63 |or = [ca|ls objec|
|00002e70| 74 45 6e 75 6d 65 72 61 | 74 6f 72 5d 3b 0a 20 20 |tEnumera|tor];. |
|00002e80| 20 20 20 20 20 20 20 20 | 20 20 4e 53 44 69 63 74 | | NSDict|
|00002e90| 69 6f 6e 61 72 79 20 2a | 63 61 6c 3b 0a 20 20 20 |ionary *|cal;. |
|00002ea0| 20 20 20 20 20 20 20 20 | 20 77 68 69 6c 65 20 28 | | while (|
|00002eb0| 28 63 61 6c 20 3d 20 5b | 65 6e 75 6d 65 72 61 74 |(cal = [|enumerat|
|00002ec0| 6f 72 20 6e 65 78 74 4f | 62 6a 65 63 74 5d 29 29 |or nextO|bject]))|
|00002ed0| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00002ee0| 20 20 20 5b 6f 75 74 70 | 75 74 20 73 65 74 4f 62 | [outp|ut setOb|
|00002ef0| 6a 65 63 74 3a 5b 63 61 | 6c 20 6f 62 6a 65 63 74 |ject:[ca|l object|
|00002f00| 46 6f 72 4b 65 79 3a 40 | 22 43 6f 6c 6f 72 22 5d |ForKey:@|"Color"]|
|00002f10| 20 66 6f 72 4b 65 79 3a | 5b 63 61 6c 20 6f 62 6a | forKey:|[cal obj|
|00002f20| 65 63 74 46 6f 72 4b 65 | 79 3a 40 22 44 65 73 63 |ectForKe|y:@"Desc|
|00002f30| 72 69 70 74 69 6f 6e 22 | 5d 5d 3b 0a 20 20 20 20 |ription"|]];. |
|00002f40| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00002f50| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 6f 75 74 | re|turn out|
|00002f60| 70 75 74 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |put;. | }. |
|00002f70| 20 20 20 7d 0a 20 20 20 | 20 72 65 74 75 72 6e 20 | }. | return |
|00002f80| 6e 69 6c 3b 0a 7d 0a 0a | 2d 20 28 4e 53 41 72 72 |nil;.}..|- (NSArr|
|00002f90| 61 79 20 2a 29 67 65 74 | 42 69 72 74 68 64 61 79 |ay *)get|Birthday|
|00002fa0| 50 65 6f 70 6c 65 0a 7b | 0a 20 20 20 20 41 42 41 |People.{|. ABA|
|00002fb0| 64 64 72 65 73 73 42 6f | 6f 6b 20 2a 41 42 20 3d |ddressBo|ok *AB =|
|00002fc0| 20 5b 41 42 41 64 64 72 | 65 73 73 42 6f 6f 6b 20 | [ABAddr|essBook |
|00002fd0| 73 68 61 72 65 64 41 64 | 64 72 65 73 73 42 6f 6f |sharedAd|dressBoo|
|00002fe0| 6b 5d 3b 0a 0a 20 20 20 | 20 2f 2f 20 54 6f 20 66 |k];.. | // To f|
|00002ff0| 69 6e 64 20 61 6c 6c 20 | 62 69 72 74 68 64 61 79 |ind all |birthday|
|00003000| 73 2c 20 77 65 27 6c 6c | 20 73 65 61 72 63 68 20 |s, we'll| search |
|00003010| 66 6f 72 20 62 69 72 74 | 68 64 61 79 73 20 61 66 |for birt|hdays af|
|00003020| 74 65 72 20 6d 69 64 6e | 69 67 68 74 20 6f 6e 20 |ter midn|ight on |
|00003030| 4a 61 6e 20 31 73 74 20 | 31 38 30 30 0a 20 20 20 |Jan 1st |1800. |
|00003040| 20 4e 53 43 61 6c 65 6e | 64 61 72 44 61 74 65 20 | NSCalen|darDate |
|00003050| 2a 64 61 74 65 20 3d 20 | 5b 4e 53 43 61 6c 65 6e |*date = |[NSCalen|
|00003060| 64 61 72 44 61 74 65 20 | 64 61 74 65 57 69 74 68 |darDate |dateWith|
|00003070| 59 65 61 72 3a 31 38 30 | 30 0a 20 20 20 20 20 20 |Year:180|0. |
|00003080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 6f 6e 74 | | mont|
|000030b0| 68 3a 31 20 64 61 79 3a | 31 20 68 6f 75 72 3a 30 |h:1 day:|1 hour:0|
|000030c0| 20 6d 69 6e 75 74 65 3a | 30 20 73 65 63 6f 6e 64 | minute:|0 second|
|000030d0| 3a 30 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:0. | |
|000030e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003100| 20 20 74 69 6d 65 5a 6f | 6e 65 3a 5b 4e 53 54 69 | timeZo|ne:[NSTi|
|00003110| 6d 65 5a 6f 6e 65 20 74 | 69 6d 65 5a 6f 6e 65 57 |meZone t|imeZoneW|
|00003120| 69 74 68 41 62 62 72 65 | 76 69 61 74 69 6f 6e 3a |ithAbbre|viation:|
|00003130| 40 22 45 53 54 22 5d 5d | 3b 0a 20 20 20 20 0a 20 |@"EST"]]|;. . |
|00003140| 20 20 20 41 42 53 65 61 | 72 63 68 45 6c 65 6d 65 | ABSea|rchEleme|
|00003150| 6e 74 20 2a 70 65 6f 70 | 6c 65 57 69 74 68 42 69 |nt *peop|leWithBi|
|00003160| 72 74 68 64 61 79 73 20 | 3d 20 5b 41 42 50 65 72 |rthdays |= [ABPer|
|00003170| 73 6f 6e 20 73 65 61 72 | 63 68 45 6c 65 6d 65 6e |son sear|chElemen|
|00003180| 74 46 6f 72 50 72 6f 70 | 65 72 74 79 3a 6b 41 42 |tForProp|erty:kAB|
|00003190| 42 69 72 74 68 64 61 79 | 50 72 6f 70 65 72 74 79 |Birthday|Property|
|000031a0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000031b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031e0| 20 20 20 20 20 20 20 20 | 6c 61 62 65 6c 3a 6e 69 | |label:ni|
|000031f0| 6c 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |l. | |
|00003200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003230| 20 20 20 20 20 20 20 20 | 20 20 20 6b 65 79 3a 6e | | key:n|
|00003240| 69 6c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |il. | |
|00003250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003260| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003280| 20 20 20 20 20 20 20 20 | 20 20 76 61 6c 75 65 3a | | value:|
|00003290| 64 61 74 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |date. | |
|000032a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032d0| 20 20 20 20 20 20 20 63 | 6f 6d 70 61 72 69 73 6f | c|ompariso|
|000032e0| 6e 3a 6b 41 42 47 72 65 | 61 74 65 72 54 68 61 6e |n:kABGre|aterThan|
|000032f0| 5d 3b 0a 20 20 20 20 0a | 20 20 20 20 4e 53 41 72 |];. .| NSAr|
|00003300| 72 61 79 20 2a 70 65 6f | 70 6c 65 46 6f 75 6e 64 |ray *peo|pleFound|
|00003310| 20 3d 20 5b 41 42 20 72 | 65 63 6f 72 64 73 4d 61 | = [AB r|ecordsMa|
|00003320| 74 63 68 69 6e 67 53 65 | 61 72 63 68 45 6c 65 6d |tchingSe|archElem|
|00003330| 65 6e 74 3a 70 65 6f 70 | 6c 65 57 69 74 68 42 69 |ent:peop|leWithBi|
|00003340| 72 74 68 64 61 79 73 5d | 3b 0a 20 20 20 20 0a 20 |rthdays]|;. . |
|00003350| 20 20 20 72 65 74 75 72 | 6e 20 70 65 6f 70 6c 65 | retur|n people|
|00003360| 46 6f 75 6e 64 3b 0a 7d | 0a 0a 2f 2f 20 65 76 65 |Found;.}|..// eve|
|00003370| 6e 74 54 69 74 6c 65 46 | 69 65 6c 64 20 64 65 6c |ntTitleF|ield del|
|00003380| 65 67 61 74 65 20 6d 65 | 74 68 6f 64 20 28 66 6f |egate me|thod (fo|
|00003390| 72 20 70 72 65 66 73 20 | 73 68 65 65 74 29 0a 2d |r prefs |sheet).-|
|000033a0| 20 28 76 6f 69 64 29 63 | 6f 6e 74 72 6f 6c 54 65 | (void)c|ontrolTe|
|000033b0| 78 74 44 69 64 43 68 61 | 6e 67 65 3a 28 4e 53 4e |xtDidCha|nge:(NSN|
|000033c0| 6f 74 69 66 69 63 61 74 | 69 6f 6e 20 2a 29 61 4e |otificat|ion *)aN|
|000033d0| 6f 74 69 66 69 63 61 74 | 69 6f 6e 0a 7b 0a 20 20 |otificat|ion.{. |
|000033e0| 20 20 69 66 20 28 5b 5b | 65 76 65 6e 74 54 69 74 | if ([[|eventTit|
|000033f0| 6c 65 46 69 65 6c 64 20 | 73 74 72 69 6e 67 56 61 |leField |stringVa|
|00003400| 6c 75 65 5d 20 6c 65 6e | 67 74 68 5d 20 3e 20 30 |lue] len|gth] > 0|
|00003410| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 5b 70 72 65 |) {. | [pre|
|00003420| 66 73 4f 4b 42 75 74 74 | 6f 6e 20 73 65 74 45 6e |fsOKButt|on setEn|
|00003430| 61 62 6c 65 64 3a 59 45 | 53 5d 3b 0a 20 20 20 20 |abled:YE|S];. |
|00003440| 7d 20 65 6c 73 65 20 7b | 0a 20 20 20 20 20 20 20 |} else {|. |
|00003450| 20 5b 70 72 65 66 73 4f | 4b 42 75 74 74 6f 6e 20 | [prefsO|KButton |
|00003460| 73 65 74 45 6e 61 62 6c | 65 64 3a 4e 4f 5d 3b 0a |setEnabl|ed:NO];.|
|00003470| 20 20 20 20 7d 0a 0a 20 | 20 20 20 69 66 20 28 5b | }.. | if ([|
|00003480| 5b 65 76 65 6e 74 54 69 | 74 6c 65 46 69 65 6c 64 |[eventTi|tleField|
|00003490| 20 73 74 72 69 6e 67 56 | 61 6c 75 65 5d 20 69 73 | stringV|alue] is|
|000034a0| 45 71 75 61 6c 54 6f 53 | 74 72 69 6e 67 3a 4e 53 |EqualToS|tring:NS|
|000034b0| 4c 6f 63 61 6c 69 7a 65 | 64 53 74 72 69 6e 67 28 |Localize|dString(|
|000034c0| 40 22 44 65 66 61 75 6c | 74 45 76 65 6e 74 4e 61 |@"Defaul|tEventNa|
|000034d0| 6d 65 53 74 72 22 2c 20 | 6e 69 6c 29 5d 29 20 7b |meStr", |nil)]) {|
|000034e0| 0a 20 20 20 20 20 20 20 | 20 5b 70 72 65 66 73 44 |. | [prefsD|
|000034f0| 65 66 61 75 6c 74 54 69 | 74 6c 65 42 75 74 74 6f |efaultTi|tleButto|
|00003500| 6e 20 73 65 74 45 6e 61 | 62 6c 65 64 3a 4e 4f 5d |n setEna|bled:NO]|
|00003510| 3b 0a 20 20 20 20 7d 20 | 65 6c 73 65 20 7b 0a 20 |;. } |else {. |
|00003520| 20 20 20 20 20 20 20 5b | 70 72 65 66 73 44 65 66 | [|prefsDef|
|00003530| 61 75 6c 74 54 69 74 6c | 65 42 75 74 74 6f 6e 20 |aultTitl|eButton |
|00003540| 73 65 74 45 6e 61 62 6c | 65 64 3a 59 45 53 5d 3b |setEnabl|ed:YES];|
|00003550| 0a 20 20 20 20 7d 0a 7d | 0a 0a 2f 2f 20 74 61 62 |. }.}|..// tab|
|00003560| 6c 65 76 69 65 77 20 64 | 65 6c 65 67 61 74 65 20 |leview d|elegate |
|00003570| 6d 65 74 68 6f 64 73 0a | 2d 20 28 76 6f 69 64 29 |methods.|- (void)|
|00003580| 74 61 62 6c 65 56 69 65 | 77 53 65 6c 65 63 74 69 |tableVie|wSelecti|
|00003590| 6f 6e 44 69 64 43 68 61 | 6e 67 65 3a 28 4e 53 4e |onDidCha|nge:(NSN|
|000035a0| 6f 74 69 66 69 63 61 74 | 69 6f 6e 20 2a 29 6e 6f |otificat|ion *)no|
|000035b0| 74 69 66 69 63 61 74 69 | 6f 6e 0a 7b 0a 20 20 20 |tificati|on.{. |
|000035c0| 20 69 66 20 28 28 5b 63 | 61 6c 54 61 62 6c 65 20 | if (([c|alTable |
|000035d0| 73 65 6c 65 63 74 65 64 | 52 6f 77 5d 20 3e 20 2d |selected|Row] > -|
|000035e0| 31 29 20 26 26 20 28 5b | 62 69 72 74 68 64 61 79 |1) && ([|birthday|
|000035f0| 50 65 6f 70 6c 65 20 63 | 6f 75 6e 74 5d 20 3e 20 |People c|ount] > |
|00003600| 30 29 20 26 26 20 28 63 | 6f 70 79 41 6c 6c 20 7c |0) && (c|opyAll ||
|00003610| 7c 20 28 6e 75 6d 55 6e | 63 6f 70 69 65 64 42 64 || (numUn|copiedBd|
|00003620| 61 79 73 20 3e 20 30 29 | 29 29 20 7b 0a 20 20 20 |ays > 0)|)) {. |
|00003630| 20 20 20 20 20 5b 63 6f | 70 79 42 75 74 74 6f 6e | [co|pyButton|
|00003640| 20 73 65 74 45 6e 61 62 | 6c 65 64 3a 59 45 53 5d | setEnab|led:YES]|
|00003650| 3b 0a 20 20 20 20 7d 20 | 65 6c 73 65 20 7b 0a 20 |;. } |else {. |
|00003660| 20 20 20 20 20 20 20 5b | 63 6f 70 79 42 75 74 74 | [|copyButt|
|00003670| 6f 6e 20 73 65 74 45 6e | 61 62 6c 65 64 3a 4e 4f |on setEn|abled:NO|
|00003680| 5d 3b 0a 20 20 20 20 7d | 0a 7d 0a 0a 2d 20 28 42 |];. }|.}..- (B|
|00003690| 4f 4f 4c 29 73 65 6c 65 | 63 74 69 6f 6e 53 68 6f |OOL)sele|ctionSho|
|000036a0| 75 6c 64 43 68 61 6e 67 | 65 49 6e 54 61 62 6c 65 |uldChang|eInTable|
|000036b0| 56 69 65 77 3a 28 4e 53 | 54 61 62 6c 65 56 69 65 |View:(NS|TableVie|
|000036c0| 77 20 2a 29 61 54 61 62 | 6c 65 56 69 65 77 0a 7b |w *)aTab|leView.{|
|000036d0| 0a 20 20 20 20 69 66 20 | 28 63 6f 70 79 69 6e 67 |. if |(copying|
|000036e0| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 72 65 74 75 |) {. | retu|
|000036f0| 72 6e 20 4e 4f 3b 0a 20 | 20 20 20 7d 0a 20 20 20 |rn NO;. | }. |
|00003700| 20 72 65 74 75 72 6e 20 | 59 45 53 3b 0a 7d 0a 0a | return |YES;.}..|
|00003710| 2d 20 28 42 4f 4f 4c 29 | 74 61 62 6c 65 56 69 65 |- (BOOL)|tableVie|
|00003720| 77 3a 28 4e 53 54 61 62 | 6c 65 56 69 65 77 20 2a |w:(NSTab|leView *|
|00003730| 29 61 54 61 62 6c 65 56 | 69 65 77 20 73 68 6f 75 |)aTableV|iew shou|
|00003740| 6c 64 53 65 6c 65 63 74 | 52 6f 77 3a 28 69 6e 74 |ldSelect|Row:(int|
|00003750| 29 72 6f 77 49 6e 64 65 | 78 0a 7b 0a 20 20 20 20 |)rowInde|x.{. |
|00003760| 69 66 20 28 63 6f 70 79 | 69 6e 67 29 20 7b 0a 20 |if (copy|ing) {. |
|00003770| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 4e 4f | r|eturn NO|
|00003780| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 72 65 74 75 |;. }.| retu|
|00003790| 72 6e 20 59 45 53 3b 0a | 7d 0a 0a 2f 2f 20 74 61 |rn YES;.|}..// ta|
|000037a0| 62 6c 65 76 69 65 77 20 | 64 61 74 61 73 6f 75 72 |bleview |datasour|
|000037b0| 63 65 20 6d 65 74 68 6f | 64 73 0a 2d 20 28 69 6e |ce metho|ds.- (in|
|000037c0| 74 29 6e 75 6d 62 65 72 | 4f 66 52 6f 77 73 49 6e |t)number|OfRowsIn|
|000037d0| 54 61 62 6c 65 56 69 65 | 77 3a 28 4e 53 54 61 62 |TableVie|w:(NSTab|
|000037e0| 6c 65 56 69 65 77 20 2a | 29 61 54 61 62 6c 65 56 |leView *|)aTableV|
|000037f0| 69 65 77 0a 7b 0a 20 20 | 20 20 72 65 74 75 72 6e |iew.{. | return|
|00003800| 20 5b 63 61 6c 4e 61 6d | 65 73 20 63 6f 75 6e 74 | [calNam|es count|
|00003810| 5d 3b 0a 7d 0a 0a 2d 20 | 28 69 64 29 74 61 62 6c |];.}..- |(id)tabl|
|00003820| 65 56 69 65 77 3a 28 4e | 53 54 61 62 6c 65 56 69 |eView:(N|STableVi|
|00003830| 65 77 20 2a 29 61 54 61 | 62 6c 65 56 69 65 77 20 |ew *)aTa|bleView |
|00003840| 6f 62 6a 65 63 74 56 61 | 6c 75 65 46 6f 72 54 61 |objectVa|lueForTa|
|00003850| 62 6c 65 43 6f 6c 75 6d | 6e 3a 28 4e 53 54 61 62 |bleColum|n:(NSTab|
|00003860| 6c 65 43 6f 6c 75 6d 6e | 20 2a 29 61 54 61 62 6c |leColumn| *)aTabl|
|00003870| 65 43 6f 6c 75 6d 6e 20 | 72 6f 77 3a 28 69 6e 74 |eColumn |row:(int|
|00003880| 29 72 6f 77 49 6e 64 65 | 78 0a 7b 0a 20 20 20 20 |)rowInde|x.{. |
|00003890| 69 66 20 28 5b 5b 61 54 | 61 62 6c 65 43 6f 6c 75 |if ([[aT|ableColu|
|000038a0| 6d 6e 20 69 64 65 6e 74 | 69 66 69 65 72 5d 20 69 |mn ident|ifier] i|
|000038b0| 73 45 71 75 61 6c 54 6f | 3a 40 22 69 63 6f 6e 22 |sEqualTo|:@"icon"|
|000038c0| 5d 29 20 7b 0a 20 20 20 | 20 20 20 20 20 4e 53 53 |]) {. | NSS|
|000038d0| 74 72 69 6e 67 20 2a 73 | 75 66 66 69 78 20 3d 20 |tring *s|uffix = |
|000038e0| 40 22 5f 75 22 3b 0a 20 | 20 20 20 20 20 20 20 69 |@"_u";. | i|
|000038f0| 66 20 28 72 6f 77 49 6e | 64 65 78 20 3d 3d 20 5b |f (rowIn|dex == [|
|00003900| 63 61 6c 54 61 62 6c 65 | 20 73 65 6c 65 63 74 65 |calTable| selecte|
|00003910| 64 52 6f 77 5d 29 20 7b | 0a 20 20 20 20 20 20 20 |dRow]) {|. |
|00003920| 20 20 20 20 20 73 75 66 | 66 69 78 20 3d 20 40 22 | suf|fix = @"|
|00003930| 5f 63 22 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |_c";. | }. |
|00003940| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 5b 4e | r|eturn [N|
|00003950| 53 49 6d 61 67 65 20 69 | 6d 61 67 65 4e 61 6d 65 |SImage i|mageName|
|00003960| 64 3a 5b 5b 63 61 6c 65 | 6e 64 61 72 73 20 6f 62 |d:[[cale|ndars ob|
|00003970| 6a 65 63 74 46 6f 72 4b | 65 79 3a 5b 63 61 6c 4e |jectForK|ey:[calN|
|00003980| 61 6d 65 73 20 6f 62 6a | 65 63 74 41 74 49 6e 64 |ames obj|ectAtInd|
|00003990| 65 78 3a 72 6f 77 49 6e | 64 65 78 5d 5d 20 73 74 |ex:rowIn|dex]] st|
|000039a0| 72 69 6e 67 42 79 41 70 | 70 65 6e 64 69 6e 67 53 |ringByAp|pendingS|
|000039b0| 74 72 69 6e 67 3a 73 75 | 66 66 69 78 5d 5d 3b 0a |tring:su|ffix]];.|
|000039c0| 20 20 20 20 7d 0a 20 20 | 20 20 65 6c 73 65 20 69 | }. | else i|
|000039d0| 66 20 28 5b 5b 61 54 61 | 62 6c 65 43 6f 6c 75 6d |f ([[aTa|bleColum|
|000039e0| 6e 20 69 64 65 6e 74 69 | 66 69 65 72 5d 20 69 73 |n identi|fier] is|
|000039f0| 45 71 75 61 6c 54 6f 3a | 40 22 6e 61 6d 65 22 5d |EqualTo:|@"name"]|
|00003a00| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 72 65 74 75 |) {. | retu|
|00003a10| 72 6e 20 5b 63 61 6c 4e | 61 6d 65 73 20 6f 62 6a |rn [calN|ames obj|
|00003a20| 65 63 74 41 74 49 6e 64 | 65 78 3a 72 6f 77 49 6e |ectAtInd|ex:rowIn|
|00003a30| 64 65 78 5d 3b 0a 20 20 | 20 20 7d 0a 20 20 20 20 |dex];. | }. |
|00003a40| 72 65 74 75 72 6e 20 6e | 69 6c 3b 0a 7d 0a 0a 40 |return n|il;.}..@|
|00003a50| 65 6e 64 0a 00 00 00 00 | 00 00 00 00 00 00 00 00 |end.....|........|
|00003a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00003a90| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|00003aa0| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|00003ab0| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|00003ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00003b90| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00003ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+